I do not use ggplot2 very much, but today I thought that I would let it switch to some graphs. But I can't figure out how to manually control colors in geom_line()
I am sure that I will miss something simple, but here is my test code:
x <- c(1:20, 1:20) variable <- c(rep("y1", 20), rep("y2", 20) ) value <- c(rnorm(20), rnorm(20,.5) ) df <- data.frame(x, variable, value ) d <- ggplot(df, aes(x=x, y=value, group=variable, colour=variable ) ) + geom_line(size=2) d
which gives me the expected result:

I thought that all I needed to do was simple:
d + scale_fill_manual(values=c("#CC6666", "#9999CC"))
But it does not change anything. What am I missing?
r ggplot2
JD Long Mar 02 '11 at 17:40 2011-03-02 17:40
source share