Re: [R] xyplot with different symbols and colors?

From: Sebastian P. Luque <>
Date: Sat 26 Aug 2006 - 02:26:57 EST

On Fri, 25 Aug 2006 17:51:24 +0200,
Stefan Grosse <> wrote:

> Dear List, I try to make a xyplot with different colors and symbols, I
> came this far:

> library(DAAG)
> xyplot(csoa~it|sex*agegp,data=tinting,groups=target,pch=list(1,2),auto.key=list(space
> = "right"))

> this produces a plot with different colors and symbols but unfortunately
> the legend does only follow the color scheme and not the different
> symbols.

> Any suggestions what to change?

I think that 'pch' is passed only to the panel function, and the key uses whatever the current trellis.par.set() is, if you don't define it explicitly (all explained in ?xyplot). I find it easier to call trellis.par.set before the xyplot:

R> trellis.par.set(superpose.symbol=list(pch=c(1, 2))) Warning message:
Note: The default device has been opened to honour attempt to modify trellis settings in: trellis.par.set(superpose.symbol = list(pch = c(1, 2))) R> xyplot(csoa~it|sex*agegp,data=tinting,groups=target,auto.key=list(space="right"))



______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Sat Aug 26 02:30:21 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sat 26 Aug 2006 - 04:24:35 EST.

Mailing list information is available at Please read the posting guide before posting to the list.