scale-fill-hue

Discrete equally-spaced hue fill scale.

Fill counterpart of scale-colour-hue.

Usage

scale-fill-hue(
  hue,
  chroma,
  luminance,
  name,
  limits,
  oob,
  labels,
)

Parameters

Parameter Default Description
hue Pair (start, end) of hue angles.
chroma Chroma in [0, 100].
luminance Luminance in [0, 100].
name Legend title. Overrides any name set via labels when both are present.
limits Array of level names controlling order and inclusion, or none.
oob Out-of-range policy: "drop" (default) removes rows whose value falls outside limits; "squish" clamps continuous values to the nearest endpoint.
labels Array of legend labels aligned with limits, or auto.

Returns

Scale object consumed by plot.

Examples

Default hue wheel shown as a swatch strip via geom-rect.

#let levels = ("a", "b", "c", "d", "e", "f", "g", "h")
#let d = levels.enumerate().map(((i, k)) => (
  xmin: i, xmax: i + 1, ymin: 0, ymax: 1, k: k,
))
#plot(
  data: d,
  mapping: aes(xmin: "xmin", xmax: "xmax", ymin: "ymin", ymax: "ymax", fill: "k"),
  layers: (geom-rect(),),
  scales: (scale-fill-hue(),),
  guides: guides(fill: none),
  theme: theme-void(),
  width: 8cm,
  height: 1cm,
)

Legend swatch strip of eight rectangles stepping evenly around the OKLCh hue wheel at full chroma and medium luminance from red through green and blue back toward red.

Legend swatch strip of eight rectangles stepping evenly around the OKLCh hue wheel at full chroma and medium luminance from red through green and blue back toward red.

See also

scale-colour-hue, scale-fill-discrete.

Back to top