Scale_colour_brewer won't change fill colors of geom_bar

2,841 views
Skip to first unread message

John

unread,
Aug 24, 2010, 3:20:48 PM8/24/10
to ggplot2
Hello,

I am trying to make a simple barplot and apply scale_colour_brewer.
The brewer colors get applied to the line color just fine, but do not
get applied to the fill colors. Any ideas? Thanks!

John

df = data.frame(Group=c('Group1', 'Group2'), Response=c(75, 50))
p = ggplot(df, aes(x=Group, y=Response, fill=Group, colour=Group))
p + geom_bar() + scale_colour_brewer()

> sessionInfo()
R version 2.11.1 (2010-05-31)
x86_64-apple-darwin9.8.0

locale:
[1] en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] grid datasets utils stats graphics grDevices
methods
[8] base

other attached packages:
[1] RColorBrewer_1.0-2 ggplot2_0.8.8 nlme_3.1-96
reshape_0.8.3
[5] plyr_1.1 proto_0.3-8 MASS_7.3-7

loaded via a namespace (and not attached):
[1] digest_0.4.2 lattice_0.18-8 tools_2.11.1

Brandon Hurr

unread,
Aug 24, 2010, 3:34:14 PM8/24/10
to John, ggplot2
Try scale_fill_brewer()


--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: http://gist.github.com/270442

To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+u...@googlegroups.com
More options: http://groups.google.com/group/ggplot2

Reply all
Reply to author
Forward
0 new messages