Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR R

how to label legends in R ggplot

#create grouped boxplots with custom legend labels
p <- ggplot(data, aes(x=team, y=values, fill=program)) + 
       geom_boxplot() +
       scale_fill_discrete(labels=c('High Program', 'Low Program'))

#display grouped boxplots
p
Source by www.statology.org #
 
PREVIOUS NEXT
Tagged: #label #legends #R #ggplot
ADD COMMENT
Topic
Name
8+8 =