[R] setup trellis.device to color=F inside the xyplot function

Sundar Dorai-Raj sundar.dorai-raj at pdf.com
Sun Aug 5 19:23:10 CEST 2007



Ronaldo Reis Junior said the following on 8/5/2007 6:18 AM:
> Hi,
> 
> it is possible to setup trellis.device(color=F) inside teh function xyplot?
> 
> I try to use 
> 
>> xyplot(ocup~tempo|
> nitro+estacao,col="white",ylim=c(0,0.7),par.settings=list(color=F))
> 
> But dont work, the only way that work for me is call the function
> 
>> trellis.device(color=F)
> 
> before the xyplot, but in this way it open a new device for each run. I like 
> that is use the same device every time, but without colors.
> 
> Thanks
> Ronaldo

Try this:

library(lattice)
x <- 1:10
y <- 1:10
g <- rep(1:2, 5)
# no color
xyplot(y ~ x | g, par.settings = standard.theme(color = FALSE))
xyplot(y ~ x, groups = g, par.settings = standard.theme(color = FALSE))
# with color
xyplot(y ~ x | g)
xyplot(y ~ x, groups = g)


HTH,

--sundar



More information about the R-help mailing list