[R] background color in strip.custom()

Duncan Mackay mackay at northnet.com.au
Mon Dec 4 23:54:02 CET 2006


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)) )


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
>
>______________________________________________
>R-help at stat.math.ethz.ch 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