[R] Scatterplot with the 3rd dimension = color?

Kerry kbrownk at gmail.com
Thu Oct 20 21:45:57 CEST 2011


If it would help get any assistance with my issue, here's another
method I'm trying (using R sample data):

ggplot(mtcars, aes(disp)) +
  geom_point(aes(y = mpg, colour = qsec))+
scale_colour_gradient(low="yellow", high="green")+
  geom_point(aes(y = cyl, colour = qsec))+
scale_colour_gradient(low="red", high="blue")

What I want is the var "mpg" to be colored by the var "qsec" from
yellow to green and then the var "cyl" to be colored by the var "qsec"
from red to blue.     Instead, both colors end up being from red to
blue.

Thanks again,
kb



More information about the R-help mailing list