Skip to main content

Function: niceAxisRange()

niceAxisRange(dataMin, dataMax, divisions): [number, number, number]

Defined in: src/mobjects/graphing/stats.ts:188

Build a padded [min, max, step] axis range that covers [dataMin, dataMax].

The range is padded by 5% on each side. Equal or reversed bounds expand to a unit-wide window so a plot axis is never zero-width. The step divides the padded span into about divisions ticks.

Parameters​

dataMin​

number

Smallest data value.

dataMax​

number

Largest data value.

divisions​

number = 5

Target tick count. Default: 5

Returns​

[number, number, number]