# Use thematic_with_theme() for a one-time use of thematic
thematic_with_theme(
thematic_theme("darkblue", "skyblue", accent = "red"),
plot(1:10, col = thematic_get_option("accent"), pch = 19)
)
# Use thematic_set_theme() if doing something more complicated
# like programming on top thematic (without causing side effects)
my_plot <- function(expr, las = 3, ...) {
old_theme <- thematic_on("black", "white")
on.exit(thematic_set_theme(old_theme), add = TRUE)
opts <- par(las = las)
on.exit(par(opts), add = TRUE)
# Imagine some more customization with ...
force(expr)
}
my_plot(plot(1:10))
thematic_off()
thematic_get_option("bg", "white")
thematic_on(bg = "red")
thematic_get_option("bg", "white")
thematic_off()
thematic_with_theme(
thematic_theme("darkblue", "skyblue"),
scales::show_col(thematic_get_mixture(seq(0, 1, by = 0.1)))
)
Run the code above in your browser using DataLab