scale_colour_manual using part of scale_colour_brewer

72 views
Skip to first unread message

Keith G.

unread,
Oct 12, 2009, 3:53:57 PM10/12/09
to ggplot2

I'd like to use a colour scale that is composed of the 8 colours from
a brewer scale, plus black as the last colour.

Can someone point me in the right direction?

Thanks!

Keith

baptiste auguie

unread,
Oct 13, 2009, 2:18:27 AM10/13/09
to Keith G., ggplot2
Hi,

Try this,

library(RColorBrewer)
qplot(x,y, data=data.frame(x=1:9,y=1:9), colour=factor(x),size=I(5)) +
scale_colour_manual(values = c(brewer.pal(8, "Set1"),"black"))

HTH,

baptiste
Reply all
Reply to author
Forward
0 new messages