apply_besthr_theme: Apply besthr theme consistently

View source: R/themes.R

apply_besthr_themeR Documentation

Apply besthr theme consistently

Description

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)


besthr documentation built on March 18, 2026, 5:08 p.m.