scale-stroke-continuous

Continuous stroke scale mapping a numeric column to outline thickness.

Usage

scale-stroke-continuous(
  name: none,
  range: (0.2pt, 1.4pt),
  limits: none,
  breaks: auto,
  labels: auto,
)

Parameters

Parameter Default Description
name none Legend title. Overrides any name set via labs when both are present.
range (0.2pt, 1.4pt) Pair of Typst lengths (min, max) bounding the output thickness.
limits none Pair (lo, hi) clipping the trained domain, or none.
breaks auto Array of break values for the legend, or auto.
labels auto Array of legend labels aligned with breaks, or auto.

Returns

Scale object consumed by plot.

Examples

Marker outline grows with w.

#let d = range(1, 8).map(i => (x: i, y: i, w: i))
#plot(
  data: d,
  mapping: aes(x: "x", y: "y", stroke: "w"),
  layers: (geom-point(size: 5pt, fill: rgb("#1f77b4")),),
  scales: (scale-stroke-continuous(range: (0.2pt, 1.6pt)),),
  width: 10cm,
  height: 6cm,
)

Scatter chart of seven blue dots along the diagonal where each marker's outline thickness scales with w from a thin to a heavy stroke.

Scatter chart of seven blue dots along the diagonal where each marker's outline thickness scales with w from a thin to a heavy stroke.

See also

scale-stroke-identity, scale-linewidth-continuous.

Back to top