Skip to contents

A minimal theme with light background inspired by — and adapted from — the occasional appearances of charts used by Apple within different contexts, e.g., Apple Health app, Screen Time on iOS and macOS.

Usage

theme_sf_light(
  font_family = "Inter",
  grid = TRUE,
  axis = TRUE,
  ticks = TRUE,
  size_class = NULL,
  font_size_class = "xSmall",
  element_size_class = "xSmall",
  offset_x_ticks = FALSE,
  offset_y_ticks = FALSE
)

Arguments

font_family

Primary font family of the plot

grid

Panel grid (TRUE, FALSE, or a combination of X, x, Y, y)

axis

Add x or y axes? TRUE, FALSE, "xy"

ticks

Ticks if TRUE add ticks

size_class

Resizes texts and elements based on one of the given size classes:

  • A character from "xSmall", "Small", "Medium", "Large", "xLarge", "xxLarge", "xxxLarge"

font_size_class

Only resizes text based on one of the above size classes

element_size_class

Only resizes elements based on one of the above size classes

offset_x_ticks

Fancier x tick labels [Experimental]

offset_y_ticks

Fancier y tick labels [Experimental]

Details

Recommended color and fill scales to be used with:

Examples

if (FALSE) {
library(ggplot2)

ggplot(mpg, aes(x = displ, y = hwy, colour = class)) +
  geom_point() +
  labs(x = "Displacement", y ="MPG",
       color = "Type of Car",
       title = "Fuel Economy",
       subtitle = "Fuel economy declines as engines get bigger",
       caption = "Fuel economy data from 1999 to 2008.") +
  theme_sf_light() +
  scale_colour_ios_light()
}