Set a Custom ggplot2 Theme
Usage
use_custom_theme(
palette = "main",
theme = "personal",
accent_color,
font = "Roboto",
reverse = FALSE
)
use_personal_theme(
palette = "main",
theme = "personal",
accent_color,
font = "Roboto",
reverse = FALSE
)
use_pedscience_theme(
palette = "main",
theme = "pedscience",
accent_color,
font = "Roboto",
reverse = FALSE
)
use_palli_theme(
palette = "main",
theme = "palli",
accent_color,
font = "Roboto",
reverse = FALSE
)
use_dksz_theme(
palette = "main",
theme = "dksz",
accent_color,
font = "Roboto",
reverse = FALSE
)
Arguments
- palette
A palette in
theming_palettes
. Can be one of"main"
"sequential"
"lighter"
"darker"
"pastel"
or a vector of strings with HEX codes
- theme
Which theme to pick the palette from. Can be one of
"personal"
"pedscience"
"palli"
"dksz"
- accent_color
The accent color. Can be a string for a HEX value. The default is the palettes accent color in
theming_palettes
- font
String, a Google Font. Default is
"Roboto"
- reverse
Logical. Should the palette be reversed?
Examples
library(ggplot2)
use_custom_theme(palette = "full")
example_plot <- mpg %>%
ggplot(aes(displ, hwy, color = as.factor(cyl))) +
geom_point()
example_plot
use_personal_theme()
example_plot
use_pedscience_theme()
example_plot
use_palli_theme()
example_plot
use_dksz_theme()
example_plot
# Reset the theme with
use_base_theme()
example_plot