[R] Lattice xyplot: Fill Legend Points

S Ellison S.Ellison at lgcgroup.com
Fri Oct 18 14:05:27 CEST 2013



> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of Rich Shepard
> Subject: [R] Lattice xyplot: Fill Legend Points
> 
>    When I specify pch = 19 for a scatter plot the points are filled
> circles.
> Deapite reading ?points and trial-and-error experimentation I have not
> found
> how to have the legend symbols (now open circles) filled.
> 

Using trellis.par.set seems more successful than specifying par.settings in the call, however much I'd prefer to avoid relying on globals. Example:

ss<-trellis.par.get("superpose.symbol")
ss$pch=rep(19,7)
ss$col=rainbow(7)
trellis.par.set(superpose.symbol=ss)

#Example from xyplot
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)


S Ellison



*******************************************************************
This email and any attachments are confidential. Any use...{{dropped:8}}



More information about the R-help mailing list