class LinearSegmentedNorm(levels, vmin=None, vmax=None, clip=False)[source]

Bases: matplotlib.colors.Normalize

This is the default normalizer paired with BinNorm whenever levels are non-linearly spaced. The normalized value is linear with respect to its average index in the levels vector, allowing uniform color transitions across arbitrarily spaced monotonically increasing values. Can be explicitly used by passing norm='segmented' to any command accepting cmap.

  • levels (list of float) – The discrete data levels.

  • vmin, vmax (None) – Ignored. vmin and vmax are set to the minimum and maximum of levels.

  • clip (bool, optional) – Whether to clip values falling outside of the minimum and maximum levels.

Methods Summary

__call__(value[, clip])

Normalize the data values to 0-1.


Inverse operation of __call__.