Axis Scales#
Specify scaling for X and Y axes.
Specify the scaling behavior for the X and Y axes, including dynamic, symmetric, positive, and negative scales.
AxisScaleDynamic #
Dynamically set y-axis extremes for optimal spacing.
Construct specifications for a dynamic scale for the y-axis of a chart. By default, it dynamically calculates axis extremes to minimize dead space in the chart.
Constructor for AxisScaleDynamic.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
tick_amount
|
int
|
number of ticks beyond min and max. |
3
|
AxisScaleSymmetric #
AxisScaleSymmetric(
*,
min_value: int | None = None,
max_value: int | None = None,
intermediate_tick_amount: int = 1,
strict: bool | None = None,
)
Y-axis scale for charts with positive and negative values.
Construct specifications for a scale for the y-axis with both positive and negative values. It determines extremes based on the maximum absolute value of the data, with 0 added as the middle tick.
Constructor for AxisScaleSymmetric.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
min_value
|
Optional[int]
|
fixed minimum value for axis. Defaults to None (calculated dynamically). |
None
|
max_value
|
Optional[int]
|
fixed maximum value for axis. Defaults to None (calculated dynamically). |
None
|
intermediate_tick_amount
|
int
|
number of ticks between min-mid and between mid and max. Defaults to 1 (axis with five ticks) |
1
|
strict
|
bool
|
Strict the Symmetry between the min and max value. Defaults to True. |
None
|
AxisScalePositive #
Y-axis scale for charts with positive values.
Construct specifications for a scale for the y-axis with only positive values. It assumes the minimum value of the chart to be fixed at 0. Specify a fixed maximum value for the axis with the max_value parameter, which defaults to None, allowing for dynamic calculation of the maximum value.
Constructor for AxisScalePositive.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
max_value
|
int | None
|
fixed maximum value for axis. Defaults to None (max value calculated dynamically) |
None
|
intermediate_tick_amount
|
int
|
number of extra ticks between extremes. |
3
|
AxisScaleNegative #
Y-axis scale for charts with negative values.
Construct specifications for a scale for the y-axis with only negative values. It assumes the maximum value of the chart to be fixed at 0. Specify a fixed minimum value for the axis with the min_value parameter, which defaults to None, allowing for dynamic calculation of the minimum value.
Constructor for AxisScaleNegative.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
min_value
|
int | None
|
fixed minimum value for axis. Defaults to None (min value calculated dynamically) |
None
|
intermediate_tick_amount
|
int
|
number of extra ticks between extremes. |
3
|
Types#
AxisScale
module-attribute
#
AxisScale = (
AxisScaleDynamic
| AxisScaleSymmetric
| AxisScalePositive
| AxisScaleNegative
)