Learn R Programming

ggblanket (version 3.0.0)

light_mode: Light theme for a ggplot

Description

Light theme for a ggplot visualisation.

Usage

light_mode(
  base_size = 10,
  base_family = "",
  base_face = "plain",
  base_pal = "#121b24",
  title_family = NULL,
  title_face = "bold",
  title_pal = NULL,
  title_size = ggplot2::rel(1.1),
  title_vjust = 0,
  title_margin = ggplot2::margin(t = base_size * -0.75, b = base_size * 2),
  subtitle_family = NULL,
  subtitle_face = NULL,
  subtitle_pal = NULL,
  subtitle_size = NULL,
  subtitle_vjust = 1,
  subtitle_margin = ggplot2::margin(t = base_size * -1, b = base_size * 2),
  caption_family = NULL,
  caption_face = NULL,
  caption_alpha = 0.33,
  caption_pal = base_pal,
  caption_size = ggplot2::rel(0.9),
  caption_hjust = 0,
  caption_vjust = 1,
  caption_margin = ggplot2::margin(t = base_size)
)

Value

A ggplot theme.

Arguments

base_size

The base size of the text. Defaults to 10.

base_family

The base family of the text. Defaults to "".

base_face

The base face of the text. Defaults to "plain".

base_pal

The base colour of the text. Defaults to "#121b24".

title_family

The font family of the title. Defaults to the base_family.

title_face

The font face of the title. Defaults to "bold".

title_pal

The colour of the title. Defaults to the base_pal.

title_size

The size of the title. Defaults to the base_size * 1.1.

title_vjust

The vertical adjustment of the title. Defaults to 0.

title_margin

The margin of the title. A ggplot2::margin function.

subtitle_family

The font family of the subtitle. Defaults to the base_family.

subtitle_face

The font face of the subtitle. Defaults to the base_face.

subtitle_pal

The colour of the subtitle. Defaults to the base_pal.

subtitle_size

The size of the subtitle. Defaults to the base_size.

subtitle_vjust

The vertical adjustment of the subtitle. Defaults to 1.

subtitle_margin

The margin of the subtitle. A ggplot2::margin function.

caption_family

The font family of the caption. Defaults to the base_family.

caption_face

The font face of the caption. Defaults to the base_face.

caption_alpha

The alpha of the caption pal. Defaults to 0.33. Use 1 for no alpha.

caption_pal

The colour of the caption (before caption_alpha is applied). Defaults to the base_pal.

caption_size

The size of the caption. Defaults to the base_size * 0.9.

caption_hjust

The horizontal adjustment of the caption. Defaults to 0.

caption_vjust

The vertical adjustment of the caption. Defaults to 1.

caption_margin

The margin of the caption. A ggplot2::margin function.

Examples

Run this code
library(palmerpenguins)
library(ggplot2)

theme_set(light_mode())

penguins |>
  gg_point(
    x = flipper_length_mm,
    y = body_mass_g,
    col = species,
    title = "Penguins body mass by flipper length",
    subtitle = "Palmer Archipelago, Antarctica",
    caption = "Source: Gorman, 2020"
  )

Run the code above in your browser using DataLab