Skip to content
ordinal_scale

ordinal_scale

Mojo module 🡭

ordinal_scale

OrdinalScale maps a fixed-order list of discrete categories onto evenly spaced pixel bands, the band scale every bar-chart-style categorical axis uses (like d3’s scaleBand, with a single padding fraction applied as an equal gap on both sides of every band).

Index-based (band_start(i)/center(i)), never looked up by category string: Plot._categorical.x is this scale’s domain, index for index. Repeated categories (grouped/stacked bars) go through Plot.encode_grouped_bar() instead.

Structs