from typing import Sequence from .charts_axis_axis_from_ticks import axis_from_ticks from .charts_axis_types import Axis, AxisOrient from .charts_scale_band_scale import band_scale def band_axis( domain: Sequence[str], range: Sequence[float], # noqa: A002 - the manifest names it range padding_inner: float, padding_outer: float, orient: AxisOrient, position: float, tick_size: float, ) -> Axis: """A category axis: one tick at the centre of each band, labelled with the category.""" positions = [band_scale(domain, range, v, padding_inner, padding_outer, 0.5).center for v in domain] return axis_from_ticks(positions, list(domain), range, orient, position, tick_size)