Skip to content

ggplot2: changing default colors of boxplot

2 messages · Brian Smith, Dennis Murphy

#
Hi:

Try this:

p <- ggplot(mtcars, aes(factor(cyl), mpg))
p + geom_boxplot(aes(colour = factor(am)), fill = 'white') +
     scale_colour_manual('am', values = c('0' = 'blue', '1' = 'black'))

HTH,
Dennis
On Tue, Oct 4, 2011 at 1:56 PM, Brian Smith <bsmith030465 at gmail.com> wrote: