scale-colour-okabe-ito

Discrete Okabe-Ito colour-vision-deficiency-safe colour scale.

Maps categorical levels to the eight-colour Okabe-Ito palette (Wong 2011, Nature Methods) in the order they first appear in the data. This palette is also the library default for unmapped discrete colour aesthetics; use this helper when you want to opt in explicitly or set name, limits, or labels.

Usage

scale-colour-okabe-ito(
  ..args,
)

Parameters

Parameter Default Description
..args

Returns

Scale object consumed by plot.

Examples

Three categorical levels mapped to the first three Okabe-Ito hues.

#let d = (
  (x: 1, y: 2, sp: "a"),
  (x: 2, y: 4, sp: "b"),
  (x: 3, y: 3, sp: "c"),
)
#plot(
  data: d,
  mapping: aes(x: "x", y: "y", colour: "sp"),
  layers: (geom-point(size: 3pt),),
  scales: (scale-colour-okabe-ito(),),
  width: 10cm,
  height: 6cm,
)

Scatter chart of three points where sp maps to the first three colours of the colour-vision-deficiency-safe Okabe-Ito palette.

Scatter chart of three points where sp maps to the first three colours of the colour-vision-deficiency-safe Okabe-Ito palette.

See also

scale-fill-okabe-ito, scale-colour-brewer, scale-colour-discrete.

Back to top