CutoffScale
- class CutoffScale(*args)[source]
Bases:
_Scale,ScaleBaseAxis scale composed of arbitrary piecewise linear transformations. The axis can undergo discrete jumps, “accelerations”, or “decelerations” between successive thresholds.
- Parameters:
*args (
thresh_1,scale_1,...,thresh_N,[scale_N], optional) – Sequence of “thresholds” and “scales”. If the final scale is omitted (i.e. you passed an odd number of arguments) it is set to1. Eachscale_iin the sequence can be interpreted as follows:If
scale_i < 1, the axis is decelerated fromthresh_itothresh_i+1. Forscale_N, the axis is decelerated everywhere abovethresh_N.If
scale_i > 1, the axis is accelerated fromthresh_itothresh_i+1. Forscale_N, the axis is accelerated everywhere abovethresh_N.If
scale_i == numpy.inf, the axis discretely jumps fromthresh_itothresh_i+1. The final scalescale_Ncannot benumpy.inf.
See also
Example
>>> import ultraplot as uplt >>> import numpy as np >>> scale = uplt.CutoffScale(10, 0.5) # move slower above 10 >>> scale = uplt.CutoffScale(10, 2, 20) # move faster between 10 and 20 >>> scale = uplt.CutoffScale(10, np.inf, 20) # jump from 10 to 20
Attributes Summary
The registered scale name
Attributes Documentation
- name = 'cutoff'
The registered scale name