[R] lattice default theme

Deepayan Sarkar deepayan at stat.wisc.edu
Thu Jan 9 17:55:03 CET 2003

On Wednesday 08 January 2003 11:27 am, apjaworski at mmm.com wrote:
> I have a feeling that this was already discussed here, but I cannot
> remember the outcome of the discussion.
> I would like to have the col.whitebg theme as a default and I cannot figure
> out how to do it.  Functions like lset or trellis.par.set require that the
> device be active, so how does one set a different default for all
> invocations of trellis.device?

No good way that I can think of, other than replacing all calls to 
trellis.device() by trellis.device(theme = col.whitebg()).

A hack is perhaps possible, which involves the global variable lattice.theme, 
which stores the settings. If you have that variable in your global 
environment (as part of your saved workspace, for example) with components 
for all the devices you want to use, lattice will use it. This will work if 
you start devices with x11(), postscript() etc. Unfortunately, any call to 
trellis.device() to start a new device will overwrite this unless retain = 
TRUE is specified. This includes the default invocation when print.trellis is 
called without any device open. 


More information about the R-help mailing list