iris.palette#
Color map pallettes management.
Load, configure and register color map palettes and initialise color map meta-data mappings.
- class iris.palette.SymmetricNormalize(pivot, *args, **kwargs)[source]#
Bases:
NormalizeProvides a symmetric normalization class around a given pivot point.
- Parameters:
vmin (float or None) – If vmin and/or vmax is not given, they are initialized from the minimum and maximum value, respectively, of the first input processed; i.e.,
__call__(A)callsautoscale_None(A).vmax (float or None) – If vmin and/or vmax is not given, they are initialized from the minimum and maximum value, respectively, of the first input processed; i.e.,
__call__(A)callsautoscale_None(A).clip (bool, default: False) –
Determines the behavior for mapping values outside the range
[vmin, vmax].If clipping is off, values outside the range
[vmin, vmax]are also transformed linearly, resulting in values outside[0, 1]. For a standard use with colormaps, this behavior is desired because colormaps mark these outside values with specific colors for over or under.If
Truevalues falling outside the range[vmin, vmax], are mapped to 0 or 1, whichever is closer. This makes these values indistinguishable from regular boundary values and can lead to misinterpretation of the data.
Notes
Returns 0 if
vmin == vmax.- property vmax#
- property vmin#
- iris.palette.auto_palette(func)[source]#
Auto palette decorator wrapper function to control the default behaviour.
Decorator wrapper function to control the default behaviour of the matplotlib cmap and norm keyword arguments.
- Parameters:
func (callable) – Callable function to be wrapped by the decorator.
- Return type:
Closure wrapper function.
- iris.palette.cmap_norm(cube)[source]#
Determine the default.
Determine the default
matplotlib.colors.LinearSegmentedColormapandiris.palette.SymmetricNormalizeinstances associated with the cube.- Parameters:
cube (
iris.cube.Cube) – Source cube to generate default palette from.- Returns:
Tuple of
matplotlib.colors.LinearSegmentedColormapandiris.palette.SymmetricNormalize- Return type:
Notes
This function maintains laziness when called; it does not realise data. See more at Real and Lazy Data.