Axis

An axis occupies the graph frame; ticks and labels extend outside it. Plot measures that overflow to reserve margins. Use an axis inside Graph to compose your own frame.

PropertyDefaultMeaning
lim[0, 1]Directed tick domain; explicit outside Plot
ticks5Target count or explicit numbers / [value, label] pairs
intervalAutomaticPositive fixed step instead of automatic 1/2/5 intervals
side"bottom"Axis edge and orientation
atFrame edgeData location on the perpendicular axis
tick-sizeem(5/16)Tick length
tick-side"outer""inner", "outer", or an explicit side
label-offsetem(1/4)Gap between ticks and labels
label-anchorSide-dependentPoint on each label attached to its tick position
formatformat_tick(value, index) => string for numeric ticks
rotate0Label rotation in degrees
labelstrueDraw tick labels
linetrueDraw the baseline
arrowfalseDraw a head at the directed endpoint
arrow-sizeem(7/16)Arrowhead length
arrow-width1.3Full arrowhead width divided by its length
arrow-style / arrow-*—Arrowhead shape and paint options
stroke-widthem(1/16)Shared baseline and tick thickness
line-style / tick-style / label-style—Nested styles for generated parts
line-* / tick-* / label-*—Flat overrides for generated-part styles

Stroke width, tick length, label offset, and arrowhead length scale with the axis's inherited font-size. At the default 16px font they measure 1px, 5px, 4px, and 7px. A label-font-size override affects the labels independently. Use explicit px(...) values to keep a dimension fixed when the font changes.

Pair labels may be strings, numbers, or Elements. Out-of-domain ticks are omitted. Use tick-side="inner" for inward ticks. "outer" follows side; explicit cardinal values such as side="bottom" with tick-side="top" are also accepted. Labels remain on side; when ticks point the other way, label-offset is measured from the baseline. Label anchors use the standard point forms. For example, a rotated bottom-axis label can hang from its top-right corner with label-anchor={['end', 'start']}. The default centers labels along the axis and selects the edge facing the axis. Arrowhead options follow ArrowHead: for example, arrow-open, arrow-curve, arrow-barb, and arrow-stroke control the head drawn by arrow. Scopes configure generated labels; supplied Elements keep their own props. Flat props override matching fields of nested objects. tick-size, tick-side, label-offset, arrow-size, arrow-width, and ordinary line-height remain owner props. These scopes also work on Axis's directional, labels-only, and scale-only variants. See scoped props.

Automatic 1/2/5 intervals need not include every endpoint; public linear_ticks and format_tick expose the helpers. Work is bounded to 10000 ticks.

Ticks and label descriptions are fixed at construction. A standalone Axis uses lim for generation and the ambient graph for mapping; provide matching limits, or let Plot construct it. Minor ticks and collision avoidance are deferred.