Skip to contents

Applies the besthr theme and color scales to a ggplot object based on configuration settings. This ensures consistent theming across all plot components.

Usage

apply_besthr_theme(p, config, include_fill = TRUE, include_color = TRUE)

Arguments

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)

Value

The ggplot object with theme and scales applied

Examples

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)