Learn R Programming

ggblanket (version 5.1.0)

pal_discrete: Default colour blind safe categorical palette with 5 colours

Description

The default colour blind safe 5 colour palette used to colour a categorical col variable.

Usage

pal_discrete

Arguments

Value

A character vector of hex codes.

Format

An object of class character of length 5.

References

Derived from a Datawrapper blog dated 30/03/2022 by Lisa Charlotte Muth.

Examples

Run this code
scales::show_col(pal_discrete)

ggplot2::diamonds |>
  gg_bar(x = color,
         col = color,
         pal = pal_discrete,
         width = 0.75)

ggplot2::diamonds |>
  gg_blank(x = color,
           col = color,
           stat = "count",
           pal = pal_discrete) +
  ggplot2::geom_point(stat = "count")

ggplot2::diamonds |>
  gg_blank(x = color,
           col = color,
           stat = "count",
           pal = pal_discrete,
           theme = dark_mode()) +
  ggplot2::geom_point(stat = "count")

Run the code above in your browser using DataLab