O'Reilly logo
  • Christopher Roach thinks this is interesting:

p + geom_point() + scale_colour_manual(values=c("orange","forestgreen"))

From

Cover of R Graphics Cookbook

Note

For this one to work, you have either have to set the colour mapping when defining the default aesthetic mappings, or you have to define the mapping specifically for the geom. So, either of the following will work:

ggplot(dat, aes(x=xval, y=yval, colour=group)) +
geom_point() +
scale_colour_manual(values=c("orange", "forestgreen"))

ggplot(dat, aes(x=xval, y=yval) +
geom_point(aes(colour=group) +
scale_colour_manual(values=c("orange", "forestgreen"))