Is it possible to build two data sets on the same site, but use different color palettes for each set?
testdf <- data.frame( x = rnorm(100), y1 = rnorm(100, mean = 0, sd = 1), y2 = rnorm(100, mean = 10, sd = 1), yc = rnorm(100, mean = 0, sd = 3)) ggplot(testdf, aes(x, y1, colour = yc)) + geom_point() + geom_point(aes(y = y2))
What I would like to see is one data set, for example y1 , in the blues (the color specified by yc ), and the other set is in red (again the color is set by yc ).
The legend should display 2 color scales, one is blue, the other is red.
Thanks for your suggestions.
colors r ggplot2 palette
drbv
source share