scale-hue
Discrete evenly-spaced HCL hue colour/fill scale.
Usage
scale-hue(
..args,
)Parameters
| Parameter | Default | Description |
|---|---|---|
..args |
Named arguments forwarded to the colour/fill scale. |
Keys accepted by ..args:
hue:(start, end)angle pair sweeping the HCL hue circle; default(15deg, 375deg).chroma: HCL chroma, a number in[0, 100]; default100.luminance: HCL luminance, a number in[0, 100]; default65.name: Axis or legend title, as a string or content;none(default) falls back to the mapped column name.limits: Array of level names selecting which levels appear and in which order;none(default) keeps the trained levels. A level name must be a string, because a discrete scale reads a bare number as a position rather than as a level, so quote a numeric level as"1".oob: Handling of rows whose level falls outsidelimits:"drop"(default) removes them;"squish"censors too, since clamping has no meaning on levels.labels: Array of labels in level order, a function of the level returning a string or content, orauto(default) to print the level itself. The entry at the position of the missing level relabels it, and a function getsnonefor it.missing-value: Value that draws the missing level, which holds the rows whose column isnoneor empty.none(default) draws it in 50 % grey.missing-translate: Whether a missing cell becomes the trailing missing level (true, default), shown as a legend key or an axis tick.falsedrops the rows that hold a missing cell after the stats and positions ran, so proportions and stack totals still count them.limitscannot name the missing level. A facet variable has no scale and always gets a trailing missing panel.
Returns
Deferred scale spec consumed by scales.
Examples
Colour groups with evenly-spaced HCL hues.
#let d = ((x: 1, y: 1, g: "a"), (x: 2, y: 2, g: "b"), (x: 3, y: 3, g: "c"))
#plot(
data: d,
mapping: aes(x: "x", y: "y", colour: "g"),
layers: (geom-point(size: 3pt),),
scales: scales(colour: scale-hue()),
width: 10cm,
height: 6cm,
)