Initializing Trellis Displays
trellis.device.RdInitialization of a display device with appropriate graphical parameters.
Usage
trellis.device(device = getOption("device"),
color = !(dev.name == "postscript"),
theme = lattice.getOption("default.theme"),
new = TRUE,
retain = FALSE,
...)Arguments
- device
function (or the name of one as a character string) that starts a device. Admissible values depend on the platform and how R was compiled (see
Devices), but usually"pdf","postscript","png","jpeg"and at least one of"X11","windows"and"quartz"will be available.- color
logical, whether the initial settings should be color or black and white. Defaults to
FALSEfor postscript devices,TRUEotherwise. Note that this only applies to the initial choice of colors, which can be overridden usingthemeor subsequent calls totrellis.par.set(and by arguments supplied directly in high level calls for some settings).- theme
list of components that changes 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. These settings are only used to modify the default settings (determined by other arguments), and need not contain all possible parameters.
A possible use of this argument is to change the default settings by specifying
lattice.options(default.theme = "col.whitebg"). For back-compatibility, this is initially (when lattice is loaded) set togetOption(lattice.theme).If
themeis 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.Deviceinside the function to ascertain what device has been opened.- new
logical flag indicating whether a new device should be started. If
FALSE, the options for the current device are changed to the defaults determined by the other arguments.- retain
logical. If
TRUEand a setting for this device already exists, then that is used instead of the defaults for this device. By default, pre-existing settings are overwritten (and lost).- name
name of the device for which the setting is required, as returned by
.Device- ...
additional parameters to be passed to the
devicefunction, most commonlyfilefor non-screen devices, as well asheight,width, etc. See the help file for individual devices for admissible arguments.
Details
The trellis.device function sets up an R graphics device for
use with lattice graphics, by opening the device if necessary, and
defining a set of associated graphical parameters (colors, line types,
fonts, etc.).
Even if a device is opened without calling trellis.device, for
example, by calling a device function directly, trellis.device
is still called automatically when a "trellis" object is
plotted. The default graphical settings used in this case can be
customized using lattice.options. It is therefore
rarely necessary for the user to call trellis.device
explicitly.
Value
None; trellis.device is called for the side effect of opening a
device and / or setting associated graphical parameters.
Note
Earlier versions of trellis.device had a bg argument to
set the background color, but this is no longer supported. If
supplied, the bg argument will be passed on to the device
function; however, this will have no effect on the Trellis settings.
It is rarely meaningful to change the background alone; if you feel
the need to change the background, consider using the theme
argument instead.
References
Sarkar, Deepayan (2008) Lattice: Multivariate Data Visualization with R, Springer. http://lmdvr.r-forge.r-project.org/
Author
Deepayan Sarkar Deepayan.Sarkar@R-project.org
See also
Lattice for an overview of the lattice package.
Devices for valid choices of device on your
platform.
standard.theme for the default theme and alternatives.