
Update ggplot2 Theme Defaults to tidyMacro Style
Source:R/set_tidyMacro_theme.R
set_tidyMacro_theme.RdSets the tidyMacro theme and color scales as the default for all subsequent ggplot2 plots in the current R session. This is convenient when creating multiple plots with consistent styling.
Details
This function modifies the default ggplot2 theme and discrete color/fill scales for the current session. All plots created after calling this function will automatically use the tidyMacro styling unless explicitly overridden.
To revert to ggplot2 defaults, use ggplot2::theme_set(ggplot2::theme_gray())
and remove the scale defaults with ggplot2::update_geom_defaults().
Examples
if (FALSE) { # \dontrun{
library(ggplot2)
library(tidyMacro)
# Set tidyMacro as default theme for the session
set_tidyMacro_theme()
# All subsequent plots will use tidyMacro styling
ggplot(mtcars, aes(x = wt, y = mpg, color = factor(cyl))) +
geom_point()
# Revert to ggplot2 defaults
theme_set(theme_gray())
} # }