theme_mps_noto: an opinionated ggplot2 theme

View source: R/theme_mps_noto.R

theme_mps_notoR Documentation

an opinionated ggplot2 theme

Description

Provides a ggplot2 theme.

Usage

theme_mps_noto(
  base_size = 11,
  base_family = "NotoSansDisplay_Condensed",
  base_line_size = 0.5,
  base_rect_size = 0.5
)

Arguments

base_size

default text size in px

base_family

defaults to "NotoSansDisplay_Condensed". Which is provided in the package. Generally, use a sensible sans serif font that is available on your system.

base_line_size

default line size

base_rect_size

default rect size

Details

Uses Google's Noto Sans Display font by default. Using the ragg::agg_png() or related graphics device should ensure the font is properly detected and used.

Examples

library(ggplot2)
library(ragg)

file <- tempfile(fileext = '.png')
agg_png(file)
ggplot(cars) +
  geom_point(aes(speed, dist)) +
  theme_mps_noto() +
  labs(title = "Cars", subtitle = "Speed and stopping distance",
       caption = "Ezekiel, M (1930) Methods of Correlation Analysis",
       x = "Speed [mph]",
       y = "Stopping Distance [ft]")
dev.off()

mps9506/mps-templates documentation built on March 16, 2023, 4:40 a.m.