theme_readthedown: ggplot2 theme to fit the readthedown Rmd format

View source: R/theme_readthedown.R

theme_readthedownR Documentation

ggplot2 theme to fit the readthedown Rmd format

Description

A ggplot theme to fit rmdformats::readthedown in terms of background color and dark grid lines.

Usage

theme_readthedown(
  base_size = 12,
  base_family = "",
  bg = "#fcfcfc",
  axis_emph = c("xy", "x", "y"),
  ...
)

Arguments

base_size

Base text size, defaults to 12.

base_family

Base text family. Use "Roboto Slab" to match the readthedown headers, or "Lato" for the body style.

bg

Background color, defaults to rmdformats::readthedown's background, ⁠#fcfcfc⁠.

axis_emph

Which axis to emphasize visually (black lines). One of ⁠"x", "y", "xy", NULL⁠.

...

Other arguments passed to ggplot2::theme().

Value

A ggplot2 theme object.

Examples

library(ggplot2)
p <- ggplot(iris, aes(x = Sepal.Width)) +
  geom_histogram(binwidth = .25) +
  labs(
    title = "Yet another iris plot",
    subtitle = "Using theme_readthedown",
    caption = "Oh hi there, didn't see you walk in"
  )

p + theme_readthedown()
## Not run: 
# These may require font installation
p + theme_readthedown(base_family = "Lato")
p + theme_readthedown(base_family = "Roboto Condensed", axis_emph = "x")

## End(Not run)

tadaadata/tadaathemes documentation built on Feb. 3, 2024, 7:43 a.m.