[R] graphical interface

Deepayan Sarkar deepayan at stat.wisc.edu
Tue Mar 16 23:41:29 CET 2004


On Tuesday 16 March 2004 09:52, Liaw, Andy wrote:
> > From: Carlos Saavedra
> >
> > Dear R users,,
> >
> > I'm having difficulties when i use the gstat extensions in R
> > especially with the graphical interface, as the
> > variograms plots are depicted with gray background and cyan
> > points for the number of pairs, Consequently the fitted variogram
> > is drawn in cyan,
> >
> > How can i change that so i could have,  white background and
> > black lines for  the fitted variogram, for the complete plot.
>
> Try:
>
> lset(theme=col.whitebg())
>
> right before the plot command.  See ?lset for more details.


Another option (if the intention is to have a black and white plot), is to 
start the device by 

trellis.device(color = FALSE)

before calling the plot command.


> [Plead to the maintainer of lattice:  Is it possible to make the theme
> an option that can be set for the session, not just for the device?]


I'm not completely sure if this is what you are looking for, but the device  
settings are ultimately determined by trellis.device(), which has a 
'theme' argument. It essentially has the effect of calling lset() with 
that theme immediately after the device is set up. This 'theme' argument 
defaults to getOption("lattice.theme"), which you can set to modify the 
default behaviour. From ?trellis.device:


   theme: list of components that change the settings of the device
          opened, or, a function that when called produces such a list.
          The function name can be supplied as a quoted string. A
          possible usage is to change the default settings at session
          startup, for example by setting 'options(lattice.theme =
          "col.whitebg")'. If 'theme' is a function, it will not be
          supplied any arguments, however, it is guaranteed that a
          device will already be open when it is called, so one may use
          '.Device' inside the function to ascertain what device has
          been opened.


If this is indeed what you are looking for, I would appreciate hearing 
about any ideas to make this information easier to get at (I guess I could 
add a link from ?lset to ?trellis.device for starters).

Deepayan




More information about the R-help mailing list