scale-binned-area

Binned area-proportional size scale.

Usage

scale-binned-area(
  ..args,
)

Parameters

Parameter Default Description
..args Named arguments forwarded to the size scale (e.g. n-breaks, breaks, range, name, limits, labels).

Returns

Deferred scale spec consumed by scales.

Examples

Bin an area-proportional size scale into discrete steps.

#let d = range(1, 8).map(i => (x: i, y: i, w: i * i))
#plot(
  data: d,
  mapping: aes(x: "x", y: "y", size: "w"),
  layers: (geom-point(),),
  scales: scales(size: scale-binned-area(n-breaks: 4, range: (1pt, 12pt))),
  width: 10cm,
  height: 6cm,
)

Scatter chart of seven diagonal points where a quadratic column is cut into four area-proportional size bins.

Scatter chart of seven diagonal points where a quadratic column is cut into four area-proportional size bins.

See also

scales, scale-area, scale-binned.

Back to top