Flexible builder behind the archetype presets (theme_strategy() and
friends). Composes ggplot2::theme_minimal() with executive-output
overrides via theme_sub_*() helpers, sets the theme geom element
so from_theme()-aware layers (e.g. ggplot2::geom_line()) inherit
the resolved linewidth and main colour, and applies the resolved
font with a fallback chain.
Arguments
- palette
Palette name (e.g.
"strategy_navy") or character vector of colours.- font
Preferred font family.
- font_fallback
Character vector of fallback families to try if
fontis unavailable. The generic R families"sans","serif", and"mono"are always recognised as terminal fallbacks.- density
One of
"normal","tight","loose". Controlspanel.spacingand axis-text margins.- context
One of
"presentation","report","screen". Drives defaultbase_sizeandplot.margin.- base_size
Base font size. If
NULL, derived fromcontext.- main_color
Routed into the theme
geomelement'sinkslot, so unmapped geoms pick it up viafrom_theme().NULLfalls back to the palette's first colour. Title colour is a fixed neutral near-black (#1A1A1A); override with a follow-ontheme()call if you want it palette-tinted.
Value
A ggplot2::theme() object.
Examples
library(ggplot2)
p <- ggplot(mtcars, aes(wt, mpg)) +
geom_point() +
ct_theme()