C_03_simpleTheme {lattice} | R Documentation |
Function to generate a simple theme
Description
Simple interface to generate a list appropriate as a theme, typically
used as the par.settings
argument in a high level call
Usage
simpleTheme(col, alpha,
cex, pch, lty, lwd, font, fill, border,
col.points, col.line,
alpha.points, alpha.line)
Arguments
col , col.points , col.line |
A color specification. |
alpha , alpha.points , alpha.line |
A numeric alpha transparency specification. The same rules as
|
cex , pch , font |
Parameters for points. Applicable for
components |
lty , lwd |
Parameters for lines. Applicable for
components |
fill |
fill color, applicable for components |
border |
border color, applicable for components
|
Details
The appearance of a lattice display depends partly on the
“theme” active when the display is plotted (see
trellis.device
for details). This theme is used to
obtain defaults for various graphical parameters, and in particular,
the auto.key
argument works on the premise that the same source
is used for both the actual graphical encoding and the legend. The
easiest way to specify custom settings for a particular display is to
use the par.settings
argument, which is usually tedious to
construct as it is a nested list. The simpleTheme
function can
be used in such situations as a wrapper that generates a suitable list
given parameters in simple name=value
form, with the nesting
made implicit. This is less flexible, but straightforward and
sufficient in most situations.
Value
A list that would work as the theme
argument to
trellis.device
and trellis.par.set
, or
as the par.settings
argument to any high level lattice function
such as xyplot
.
Author(s)
Deepayan Sarkar Deepayan.Sarkar@R-project.org, based on a suggestion from John Maindonald.
See Also
trellis.device
, xyplot
,
Lattice
Examples
str(simpleTheme(pch = 16))
dotplot(variety ~ yield | site, data = barley, groups = year,
auto.key = list(space = "right"),
par.settings = simpleTheme(pch = 16),
xlab = "Barley Yield (bushels/acre) ",
aspect=0.5, layout = c(1,6))