custom.lattice: Custom grey lattice theme

View source: R/custom_theme.R

custom.latticeR Documentation

Custom grey lattice theme

Description

Custom theme for lattice plots. Some graphical parameters can be passed to override the defaults. Size parameters are relative.

Usage

custom.lattice(
  col = c("#00526D", colorspace::rainbow_hcl(n = 6, c = 90, l = 50)),
  symbol_type = 19,
  symbol_size = 1,
  line_type = 1,
  line_size = 1,
  text_type = 1,
  text_size = 1
)

Arguments

col

default colors for the theme

symbol_type

symbol(s) for the theme ('pch', defaults to 19)

symbol_size

relative expansion factor (default 1)

line_type

line type(s) for the theme ('lty', defaults to 1)

line_size

relative expansion factor (default 1)

text_type

the font face, a number form 1 to 4 for normal, bold, italic, bold + italic

text_size

relative expansion factor (default 1)

Examples

library(lattice)
data(mtcars)

xyplot(mpg ~ factor(carb) | gear, mtcars,
  groups = carb, auto.key = list(columns = 3),
  par.settings = custom.lattice(),
  panel = function(x, y, ...) {
    panel.grid(h = -1, v = -1, col = grey(0.95))
    panel.xyplot(x, y, ...)
    panel.lmline(x, y, ...)
  }
)


m-jahn/lattice-tools documentation built on Dec. 3, 2023, 11:14 p.m.