[R] background color in strip.custom()

Deepayan Sarkar deepayan.sarkar at gmail.com
Tue Dec 5 00:42:27 CET 2006


On 12/4/06, Duncan Mackay <mackay at northnet.com.au> wrote:
> One way is to use the argument par.settings
>
> get the right name
>
> names(trellis.par.get())
>
> or
>
> str(trellis.par.get())
>
> to find the list names to change
>
> then
>
> xyplot(y ~ x | f,
>            par.settings = list(strip.background = list(col = c(your colours)) )

That's answering a slightly different question, I think.

-Deepayan

>
>
> Regards
>
> Duncan
>
> Duncan Mackay
> Department of Agronomy and Soil Science
> University of New England
> ARMIDALE NSW 2351
> Email: dmackay9 at pobox.une.edu.au
>    home: mackay at northnet.com.au
> Phone: 02 6772 9794
>
> At 20:01 04/12/06, you wrote:
> >Hi all,
> >how can I change the background color in lattice strips according to a
> >factor level, eg:
> >
> >library(lattice)
> >x <- rnorm(100)
> >y <- sqrt(x)
> >f <- gl(2, 50, c("A", "B"))
> >xyplot(y ~ x | f)
> >
> >I like to change the background color of the strips according to the
> >levels in f and tried several things like this with no success:
> >
> >xyplot(y ~ x | f, strip=strip.custom(bg=c("red", "green")))
> >
> >Is this possible?
> >
> >Thanks, Sven




More information about the R-help mailing list