CutoffScale¶
-
class
CutoffScale(*args, **kwargs)[source]¶ Bases:
proplot.axistools._ScaleBase,matplotlib.scale.ScaleBaseAxis scale with arbitrary successive thresholds between which are discrete jumps, “accelerations”, or “decelerations”. Adapted from this stackoverflow post.
- 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 args) it is set to
1.If
scale_i < 1, the axis is decelerated fromthresh_itothresh_i+1or, ifi == N, everywhere abovethresh_i.If
scale_i > 1, the axis is accelerated fromthresh_itothresh_i+1or, ifi == N, everywhere abovethresh_i.If
scale_i == np.inf, the axis discretely jumps fromthresh_itothresh_i+1.
Example
>>> import proplot as plot ... import numpy as np ... thresh = plot.CutoffScale(10, 2) # go "twice as fast" after 10 ... skip = plot.CutoffScale(10, 0.5, 20) # zoom in between 10 and 20 ... jump = plot.CutoffScale(10, np.inf, 20) # jump from 10 to 20
Attributes Summary
The registered scale name.