ggprism icon indicating copy to clipboard operation
ggprism copied to clipboard

Cant hide legend

Open HugoGit39 opened this issue 2 years ago • 1 comments

Hi first of all great package! However I have an issues with hiding the legend....adding:

plot + theme(legend.title = element_blank()) doesnt seem to work....adding show.legend = F to the aes of ggplot does work but every time I add plot + theme_prism() the legend pops back up

HugoGit39 avatar Apr 18 '22 12:04 HugoGit39

Thanks!

I'm having a bit of trouble reproducing the issue. Could you post your code/a reproducible example?

library(ggplot2)
library(ggprism)

tg <- ToothGrowth
tg$dose <- as.factor(tg$dose)

ggplot(tg, aes(x = supp, y = len)) + 
  geom_boxplot(aes(fill = supp)) 

ggplot(tg, aes(x = supp, y = len)) + 
  geom_boxplot(aes(fill = supp)) + 
  theme(legend.title = element_blank())

ggplot(tg, aes(x = supp, y = len)) + 
  geom_boxplot(aes(fill = supp)) + 
  theme(legend.title = element_blank()) + 
  theme_prism()

Created on 2022-06-27 by the reprex package (v2.0.1)

csdaw avatar Jun 27 '22 09:06 csdaw