scale-fill-grey

Discrete grey fill scale.

Fill counterpart of scale-colour-grey.

Usage

scale-fill-grey(
  ..args,
)

Parameters

Parameter Default Description
..args

Returns

Scale object consumed by plot.

Examples

Default grey ramp shown as a swatch strip via geom-rect.

#let levels = ("a", "b", "c", "d", "e", "f")
#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-grey(),),
  guides: guides(fill: guide-none()),
  width: 8cm,
  height: 1cm,
)

Legend swatch strip of six rectangles stepping evenly from dark grey on the left to light grey on the right along the default grey fill ramp.

Legend swatch strip of six rectangles stepping evenly from dark grey on the left to light grey on the right along the default grey fill ramp.

See also

scale-colour-grey, scale-fill-discrete.

Back to top