Learn R Programming

playwith (version 0.9-32)

custom.theme.black: Alternative Lattice themes

Description

Alternative Lattice themes.

Usage

custom.theme.2(symbol = brewer.pal(n = 9, name = "Set1")[c(2:1, 3:5, 7:9)],
               fill = brewer.pal(n = 8, name = "Accent"),
               region = brewer.pal(n = 11, name = "RdBu"),
               reference = "#e8e8e8", bg = "transparent", fg = "black")

custom.theme.black(symbol = brewer.pal(n = 8, name = "Set2"),
                   fill = brewer.pal(n = 8, name = "Set2"),
                   region = rev(brewer.pal(n = 9, name = "YlOrRd")),
                   reference = "#444444", bg = "black", fg = "white",
                   etc = TRUE)

Arguments

symbol
colors for points and lines.
fill
colors for polygons.
region
color ramp for continuous regions.
reference
color of reference lines.
bg
background color.
fg
foreground color.
etc
TRUE to set extra graphical parameters designed for black backgrounds.

Value

  • a list of settings suitable for passing to trellis.par.set.

Details

These are wrappers around custom.theme with different defaults. They can be used as Lattice themes. The etc argument sets:
  • grey strips;
  • solid plot symbols;
  • translucent plot symbols (alpha = 0.5);
  • thick lines;
  • no borders on polygons.
These settings can be modified by editing the resulting list. An easy way to do that is via simpleTheme (see examples).

See Also

custom.theme, simpleTheme

Examples

Run this code
opar <- trellis.par.get()

trellis.par.set(custom.theme.2())
latticeStyleDemo()
trellis.par.set(custom.theme.black())
latticeStyleDemo()

## make changes to the theme
myTheme <- modifyList(custom.theme.black(),
                      simpleTheme(alpha.points = 0.1))
myTheme$add.line$lty <- 3
## now apply myTheme, or just:
trellis.par.set(simpleTheme(alpha.points = 0.1))
trellis.par.set(add.line = list(lty = 3))
latticeStyleDemo()

trellis.par.set(opar)

Run the code above in your browser using DataLab