Hi, I have a qplot like the one in the minimal example below, except I also have faceting like this:
qplot(jitter(Goodall),jitter(Better.adapt),colour=Second.adapt,facets=~Pol,data=d1) and with the real data I get quite a lot of overplotting, so I would like to add an alpha channel. In addition, I would like to be able to control which colors are used for each value of Second.adapt (which takes 7 different values). With my original data, qplot by default uses a range from blue to red, which is quite suitable, but I probably need to change this to shades of grey for publication. I tried qplot(jitter(Goodall),jitter(Better.adapt),colour=I(alpha(Second.adapt,1/5)),facets=~Pol,data=d1) but that does not give me what I want (There is no legend and I don't think anything corresponds to the seven values of Second.adapt). Minimal example: Goodall <- c(rep(1:3,5)) Better.adapt <- c(rep(1,7),rep(2,8)) Second.adapt <- c(rep(1:5,3)) d1 <- data.frame(Goodall=c(Goodall),Better.adapt=c(Better.adapt),Second.adapt=c(Second.adapt)) library(ggplot2) qplot(jitter(Goodall),jitter(Better.adapt),colour=Second.adapt,data=d1) # follwoing doesn't work: qplot(jitter(Goodall),jitter(Better.adapt),colour=I(alpha(Second.adapt,1/5)),data=d1) Thanks for any pointers, Marianne -- Marianne Promberger PhD http://www.psych.upenn.edu/~mpromber PGP/GnuPG public key ID 80AD9916 ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.