[R] Lattice group colors?

Sundar Dorai-Raj sdorairaj at gmail.com
Mon Jun 22 15:43:25 CEST 2009


Look at show.settings() and str(trellis.par.get()). This will show you
what the default settings are. The group colors are set by the
superpose.* elements (e.g. superpose.line is for group lines). To set
them, I usually create a list and pass it to par.settings. For
example,

my.theme <- list(superpose.line = list(col = c("darkred", "darkblue"),
lty = 1:2))
xyplot(y ~ x, data = mydata, groups = g, par.settings = my.theme,
  auto.key = list(points = FALSE, lines = TRUE))

HTH,

--sundar

On Mon, Jun 22, 2009 at 6:30 AM, Fredrik Karlsson<dargosch at gmail.com> wrote:
> Dear list,
>
> I have been struggling to find how I would go about changing the
> bakground colors of groups in a lattice barchart in a way so that the
> auto.key generated also does the right thing and pick it up for the
> key.
> I have used the "col" argument (which I guess is sent to par()) in a
> way so that the colors are like I would want them, but now I guess I
> need to know which part part of the theme I need to change in order to
> make this change permanent for all the plots, and all the keys.
>
> I am of course thankful for all the help I can get.
>
> (Also, how does one know these things about the theme variables? Is
> there some documentation somewhere?)
>
> /Fredrik
>
> --
> "Life is like a trumpet - if you don't put anything into it, you don't
> get anything out of it."
>
> ______________________________________________
> R-help at r-project.org 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