Scales
Functions
col-mix- Blend two colours.expand-limits- Ensure the trained domain includes the supplied values without replacing it.
Alpha scales
scale-alpha-binned- Binned continuous alpha scale.scale-alpha-continuous- Continuous alpha (opacity) scale mapping a numeric column to opacities.scale-alpha-identity- Alpha scale that uses each row’s value as the opacity directly.scale-alpha-manual- Manual discrete alpha scale: supply a per-level array of opacities.
Colour and fill: binned
scale-colour-fermenter- Binned ColorBrewer colour scale.scale-colour-steps- Binned two-stop colour gradient.scale-colour-steps2- Binned diverging colour gradient through a midpoint.scale-colour-stepsn- Binned n-stop colour gradient.scale-colour-viridis-b- Binned viridis colour scale.scale-fill-fermenter- Binned ColorBrewer fill scale.scale-fill-steps- Binned two-stop fill gradient.scale-fill-steps2- Binned diverging fill gradient through a midpoint.scale-fill-stepsn- Binned n-stop fill gradient.scale-fill-viridis-b- Binned viridis fill scale.
Colour and fill: continuous
scale-colour-continuous- Continuous colour scale mapping a numeric column to stroke colours.scale-colour-distiller- Continuous ColorBrewer colour scale.scale-colour-gradient- Continuous two-stop colour gradient.scale-colour-gradient2- Continuous diverging colour gradient through a midpoint.scale-colour-gradientn- Continuous n-stop colour gradient.scale-colour-viridis-c- Continuous viridis colour scale.scale-fill-continuous- Continuous fill scale mapping a numeric column to fill colours.scale-fill-distiller- Continuous ColorBrewer fill scale.scale-fill-gradient- Continuous two-stop fill gradient.scale-fill-gradient2- Continuous diverging fill gradient through a midpoint.scale-fill-gradientn- Continuous n-stop fill gradient.scale-fill-viridis-c- Continuous viridis fill scale.
Colour and fill: discrete
scale-colour-brewer- Discrete ColorBrewer colour scale.scale-colour-discrete- Discrete colour scale mapping categorical levels to stroke colours.scale-colour-grey- Discrete grey colour scale.scale-colour-hue- Discrete equally-spaced hue colour scale.scale-colour-okabe-ito- Discrete Okabe-Ito colour-vision-deficiency-safe colour scale.scale-colour-viridis-d- Discrete viridis colour scale.scale-fill-brewer- Discrete ColorBrewer fill scale.scale-fill-discrete- Discrete fill scale mapping categorical levels to fill colours.scale-fill-grey- Discrete grey fill scale.scale-fill-hue- Discrete equally-spaced hue fill scale.scale-fill-okabe-ito- Discrete Okabe-Ito colour-vision-deficiency-safe fill scale.scale-fill-viridis-d- Discrete viridis fill scale.
Colour and fill: manual and identity
scale-colour-identity- Colour scale that uses each row’s value as the stroke colour directly.scale-colour-manual- Manual discrete colour scale: supply the colour array directly.scale-fill-identity- Fill scale that uses each row’s value as the fill colour directly.scale-fill-manual- Manual discrete fill scale: supply the colour array directly.
Linetype scales
scale-linetype- Discrete linetype scale: maps levels to dash-pattern keywords.scale-linetype-binned- Binned linetype scale: cuts a continuous variable inton-breaksbins, each bin gets one dash keyword frompalette.scale-linetype-continuous- Continuous linetype scale: alias ofscale-linetype-binnedwith the default bin count. Provided as an explicit-name alias.scale-linetype-discrete- Discrete linetype scale: alias ofscale-linetype.scale-linetype-identity- Linetype scale that uses each row’s value as the dash keyword directly.scale-linetype-manual- Manual discrete linetype scale: supply the dash-keyword array directly.
Linewidth scales
scale-linewidth-binned- Binned continuous linewidth scale.scale-linewidth-continuous- Continuous linewidth scale mapping a numeric column to stroke thickness.scale-linewidth-identity- Linewidth scale that uses each row’s value as the stroke thickness.scale-linewidth-manual- Manual discrete linewidth scale: supply a per-level array of Typst lengths.
Palettes
brewer-palette- Look up a ColorBrewer palette by name.okabe-ito- Okabe-Ito colour-vision-deficiency-safe qualitative palette.
Position scales
scale-x-binned- Binned continuous x scale: quantises a numeric axis inton-breaksbins.scale-x-continuous- Continuous x scale: axis title, limits, breaks, labels, and transformation.scale-x-date- Continuous x scale that formats axis labels as dates.scale-x-datetime- Continuous x scale that formats axis labels as datetimes.scale-x-discrete- Discrete x scale: axis title, level ordering, and tick labels.scale-x-log10- Continuous x scale on a base-10 log axis.scale-x-reverse- Continuous x scale flipped left-to-right.scale-x-sqrt- Continuous x scale on a square-root axis.scale-x-time- Continuous x scale that formats axis labels as times of day.scale-y-binned- Binned continuous y scale: quantises a numeric axis inton-breaksbins.scale-y-continuous- Continuous y scale: axis title, limits, breaks, labels, and transformation.scale-y-date- Continuous y scale that formats axis labels as dates.scale-y-datetime- Continuous y scale that formats axis labels as datetimes.scale-y-discrete- Discrete y scale: axis title, level ordering, and tick labels.scale-y-log10- Continuous y scale on a base-10 log axis.scale-y-reverse- Continuous y scale flipped bottom-to-top.scale-y-sqrt- Continuous y scale on a square-root axis.scale-y-time- Continuous y scale that formats axis labels as times of day.
Secondary axes
Shape scales
scale-shape- Discrete shape scale: maps levels to marker-shape keywords.scale-shape-binned- Binned shape scale: cuts a continuous variable inton-breaksbins, each bin gets one shape frompalette.scale-shape-identity- Shape scale that uses each row’s value as the marker keyword directly.scale-shape-manual- Manual discrete shape scale: supply the shape-keyword array directly.
Size scales
scale-radius- Linear-radius continuous size scale.scale-size-area- Area-proportional continuous size scale.scale-size-binned- Binned continuous size scale mapping a numeric column ton-breakssizes.scale-size-binned-area- Binned area-proportional size scale.scale-size-continuous- Continuous size scale mapping a numeric column to a size range.scale-size-identity- Size scale that uses each row’s value as the marker or line size.scale-size-manual- Manual discrete size scale: supply a per-level array of Typst lengths.
Stroke scales
scale-stroke-binned- Binned continuous stroke scale.scale-stroke-continuous- Continuous stroke scale mapping a numeric column to outline thickness.scale-stroke-identity- Stroke scale that uses each row’s value as the outline thickness.scale-stroke-manual- Manual discrete stroke scale: supply a per-level array of Typst lengths.