use_carto_theme: Set a ggplot2 Theme Using CARTO Colors

View source: R/use_custom_theme.R

use_carto_themeR Documentation

Set a ggplot2 Theme Using CARTO Colors

Description

https://carto.com/carto-colors/

Usage

use_carto_theme(
  qualitative_scale = "Vivid",
  sequential_scale = "Mint",
  qualitative_accent = TRUE,
  font = "Roboto",
  reverse = FALSE
)

Arguments

qualitative_scale

String, one of

  • "Vivid" (the default)

  • "Safe"

  • "Prism"

  • "Pastel"

  • "Bold"

  • "Antique"

sequential_scale

String, for sequential scale one of

  • "Mint" (the default)

  • "TealGrn"

  • "Teal"

  • "SunsetDark"

  • "Sunset"

  • "RedOr"

  • "PurpOr"

  • "Purp"

  • "PinkYl"

  • "Peach"

  • "OrYel"

  • "Magenta"

  • "Emrld"

  • "DarkMint"

  • "BurgYl"

  • "Burg"

  • "BrwnYl"

  • "BluYl"

  • "BluGrn" For diverging scales one of

  • "Tropic"

  • "Temps"

  • "TealRose"

  • "Geyser"

  • "Fall"

  • "Earth"

  • "ArmyRose"

qualitative_accent

Logiocal, should the accent color come from the qualitative scale?

font

String, a font family from Google Fonts

reverse

Logical, should color scale be reversed?

Value

Nothing, called for side effects only

Examples

library(ggplot2)

use_carto_theme()
palmer_penguins |>
  ggplot(aes(bill_length_mm, flipper_length_mm, color = species)) +
  geom_point()


palmer_penguins |>
  ggplot(aes(bill_length_mm, flipper_length_mm, color = body_mass_g)) +
  geom_point()

benediktclaus/benelib documentation built on Feb. 1, 2024, 1:39 a.m.