Skip to contents

The single ggplot2 theme every cr_plot_* function applies, so that figures assembled from different functions sit together without re-styling: a classic axis-line frame, a faint major grid, a bold title, a muted subtitle and a bottom legend.

Usage

cr_theme(
  base_size = 11,
  base_family = "sans",
  grid = TRUE,
  legend_position = "bottom",
  variant = c("publication", "report"),
  mode = c("colour", "grayscale")
)

Arguments

base_size

Base font size in points (default 11).

base_family

Base font family. Default generic "sans".

grid

Draw the faint major grid (default TRUE).

legend_position

Passed to ggplot2::theme(). Default "bottom".

variant

"publication" or a tighter "report" layout.

mode

Colour or grayscale mode. Typography is shared across modes.

Value

A ggplot2 theme object, usable with + like any other theme.

Examples

df <- data.frame(g = rep(c("a", "b"), each = 20), y = rnorm(40))
ggplot2::ggplot(df, ggplot2::aes(g, y)) +
  ggplot2::geom_boxplot() +
  cr_theme()