LinearSegmentedNorm¶
-
class
LinearSegmentedNorm(levels, vmin=None, vmax=None, **kwargs)[source]¶ Bases:
matplotlib.colors.NormalizeThis is the default normalizer paired with
BinNormwheneverlevelsare non-linearly spaced. The normalized value is linear with respect to its average index in thelevelsvector, allowing uniform color transitions across arbitrarily spaced monotonically increasing values.It accomplishes this following the example of the
LinearSegmentedColormapsource code, by performing efficient, vectorized linear interpolation between the provided boundary levels.Can be used by passing
norm='segmented'ornorm='segments'to any command acceptingcmap. The default midpoint is zero.- Parameters
levels (list of float) – The discrete data levels.
vmin, vmax (None) – Ignored, because
vminandvmaxare set to the minimum and maximum oflevels.**kwargs – Passed to
Normalize.
Methods Summary
__call__(xq[, clip])Normalizes data values to the range 0-1.
inverse(yq)Inverse operation of
__call__.