On Feb 5, 2008 3:50 AM, Bram Kuijper <[EMAIL PROTECTED]> wrote: > Hi all, > > is it possible to dynamically add key items to an already existing key, > belonging to a lattice xyplot?
It's not lattice, but this is pretty easy to do with ggplot2: install.packages("ggplot2") library(ggplot2) qplot(mpg, wt, data=mtcars, colour="1") + geom_point(aes(x = mpg ^ 2, colour="2")) + geom_point(aes(x=mpg^3, colour="3")) + scale_colour_discrete("x power") each time you add a new layer, all of the scale limits are recalculated to ensure that all data is displayed. You can read more about ggplot2 at http://had.co.nz/ggplot2 Hadley -- http://had.co.nz/ ______________________________________________ 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.