scale-stroke-identity

Stroke scale that uses each row’s value as the outline thickness.

Values must be Typst lengths. No legend is drawn because the column carries the visual outcome verbatim.

Usage

scale-stroke-identity(
  name: none,
)

Parameters

Parameter Default Description
name none Legend title. Identity scales draw no legend.

Returns

Scale object consumed by plot.

Examples

Pass per-row Typst lengths from a t column straight through to the marker outline.

#let d = (
  (x: 1, y: 1, t: 0.2pt),
  (x: 2, y: 2, t: 0.8pt),
  (x: 3, y: 3, t: 2pt),
)
#plot(
  data: d,
  mapping: aes(x: "x", y: "y", stroke: "t"),
  layers: (geom-point(size: 6pt, fill: rgb("#1f77b4")),),
  scales: (scale-stroke-identity(),),
  width: 10cm,
  height: 6cm,
)

Scatter chart of three blue markers along the diagonal whose outline thicknesses come from the t column verbatim via the stroke identity scale.

Scatter chart of three blue markers along the diagonal whose outline thicknesses come from the t column verbatim via the stroke identity scale.

See also

scale-stroke-continuous.

Back to top