A ggplot2 theme with opinionated defaults. Light background, no grid lines, legend at the bottom, etc.

theme_clean(
  base_size = 11,
  strip_text_size = 12,
  strip_text_margin = 5,
  subtitle_size = 13,
  subtitle_margin = 10,
  plot_title_size = 16,
  plot_title_margin = 10,
  ...
)

Arguments

base_size

base font size

strip_text_size

font size for strip text (facet text)

strip_text_margin

strip text margin

subtitle_size

font size for subtitle

subtitle_margin

subtitle margin

plot_title_size

font size for title

plot_title_margin

title margin

...

additional arguments passed to theme()

Examples

library(ymisc)
library(ggplot2)
diamonds %>%
  ggplot() +
  geom_hex(aes(carat, price, fill = cut)) +
  theme_clean()
#> Warning: Computation failed in `stat_binhex()`
#> Caused by error in `compute_group()`:
#> ! The package `hexbin` is required for `stat_binhex()`