[R] lattice plots: filled points in the key

Deepayan Sarkar deepayan.sarkar at gmail.com
Mon May 28 00:52:20 CEST 2007


On 5/27/07, Renaud Lancelot <renaud.lancelot at gmail.com> wrote:
> I wonder why the following code does not produce filled points in the
> key, as I would have expected:
>
> > library(lattice)
> > x <- 1:10
> > y <- rnorm(10)
> > xyplot(y ~ x, pch = 21, col = "black", fill = "grey",
> +        key = list(space = "top",
> +                   text = list("data"),
> +                   points = list(pch = 21, col = "black", fill = "grey")))

A bug. I've committed a fix and will upload a new version soon.

> Is there a simple solution to get filled points un the key ?

In your example, adding this should work:

par.settings = list(grid.pars = list(fill = "grey")),

but this won't work for more than one fill color.

-Deepayan



More information about the R-help mailing list