LinearSegmentedNorm¶
-
class
LinearSegmentedNorm
(levels, vmin=None, vmax=None, **kwargs)[source]¶ Bases:
matplotlib.colors.Normalize
This is the default normalizer paired with
BinNorm
wheneverlevels
are non-linearly spaced. The normalized value is linear with respect to its average index in thelevels
vector, allowing uniform color transitions across arbitrarily spaced monotonically increasing values.It accomplishes this following the example of the
LinearSegmentedColormap
source 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
vmin
andvmax
are 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__
.