custom.lattice | R Documentation |
Custom theme for lattice plots. Some graphical parameters can be passed to override the defaults. Size parameters are relative.
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
)
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) |
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, ...)
}
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.