Hi, how can I change the plotting symbol for the groups in a trellis panel dotplot. My graph is similar to: library(trellis) dotplot(variety ~ yield | site, data = barley, groups = year, key = simpleKey(levels(barley$year), space = "right"), xlab = "Barley Yield (bushels/acre) ", aspect=0.5, layout = c(1,6), ylab=NULL) I'd like to plot the different years with different symbols (eg. one with pch=19 the other with pch=21 or so). Thank you very much for your help. Tom
Gabor Grothendieck
2007-Jan-30 21:55 UTC
[R] change plotting symbol for groups in trellis graph
Try this: library(lattice) dotplot(variety ~ yield | site, data = barley, groups = year, auto.key = list(space = "right"), xlab = "Barley Yield (bushels/acre) ", aspect=0.5, layout = c(1,6), ylab=NULL, par.settings = list(superpose.symbol = list(pch = c(19, 21)))) On 1/30/07, Tom Boonen <tom.boonen.maiden at gmail.com> wrote:> Hi, > > how can I change the plotting symbol for the groups in a trellis panel dotplot. > > My graph is similar to: > > library(trellis) > dotplot(variety ~ yield | site, data = barley, groups = year, > key = simpleKey(levels(barley$year), space = "right"), > xlab = "Barley Yield (bushels/acre) ", > aspect=0.5, layout = c(1,6), ylab=NULL) > > I'd like to plot the different years with different symbols (eg. one > with pch=19 the other with pch=21 or so). Thank you very much for your > help. > > Tom > > ______________________________________________ > R-help at stat.math.ethz.ch 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. >