| apply_besthr_theme | R Documentation |
Applies the besthr theme and color scales to a ggplot object based on configuration settings. This ensures consistent theming across all plot components.
apply_besthr_theme(p, config, include_fill = TRUE, include_color = TRUE)
p |
A ggplot object |
config |
A besthr_plot_config object |
include_fill |
Logical, whether to apply fill scale (default TRUE) |
include_color |
Logical, whether to apply color scale (default TRUE) |
The ggplot object with theme and scales applied
library(ggplot2)
p <- ggplot(mtcars, aes(mpg, wt, color = factor(cyl))) +
geom_point()
cfg <- besthr_plot_config(theme_style = "modern", color_palette = "okabe_ito")
apply_besthr_theme(p, cfg)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.