[R] change plotting symbol for groups in trellis graph

Gabor Grothendieck ggrothendieck at gmail.com
Tue Jan 30 22:55:12 CET 2007


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.
>



More information about the R-help mailing list