Usage
tinytheme(
theme = c("default", "basic", "dynamic", "clean", "clean2", "bw", "classic", "minimal",
"ipsum", "dark", "ridge", "ridge2", "tufte", "void"),
...
)
Details
Sets a list of graphical parameters using tpar()
Persistent vs. ephemeral themes. Calling tinytheme(“<theme>”) triggers a persistent theme, which will be applied to all subsequent graphics (incl. base plot). To reset the theme to your default settings, call tinytheme() without arguments. Alternatively, invoke the tinyplot(…, theme = <theme>) argument for an ephemeral theme that is automatically reset at the end of the plot call.
# Set a persistent theme
tinytheme("clean")
tinyplot(1:10) # uses "clean"
tinyplot(10:1) # still uses "clean"
tinytheme() # reset to default
# Use an ephemeral theme for a single plot (incl. added components)
tinyplot(1:10, theme = "dark") # uses "dark" ephemerally
tinyplot_add(type = "S") # same plot, so retains theme
tinyplot(10:1) # new plot, so back to default
Custom overrides. To customize a theme’s parameters (e.g., mar, las, etc.), pass them directly as additional args to tinytheme(<theme>, …). Please note that passing overrides through tpar() or par() won’t work, because themes work by installing a persistent hook, which means that an active theme will override any subsequent calls for parameters that the theme controls.
# Do this
tinytheme("clean", mar = c(5, 5, 2, 2))
<some plot>
# Not this (the theme hook will overwrite your changes)
tinytheme("clean")
tpar(mar = c(5, 5, 2, 2))
<some plot>
Caveats. Known tinytheme limitations include: