iris.palette#
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) –
If
Truevalues falling outside the range[vmin, vmax], are mapped to 0 or 1, whichever is closer, and masked values are set to 1. IfFalsemasked values remain masked.Clipping silently defeats the purpose of setting the over, under, and masked colors in a colormap, so it is likely to lead to surprises; therefore the default is
clip=False.
Notes
Returns 0 if
vmin == vmax.- property vmax#
- property vmin#
- iris.palette.auto_palette(func)[source]#
Decorator wrapper function to control the default behaviour of the matplotlib cmap and norm keyword arguments.
Args:
- func (callable):
Callable function to be wrapped by the decorator.
- Returns
Closure wrapper function.
- iris.palette.cmap_norm(cube)[source]#
Determine the default
matplotlib.colors.LinearSegmentedColormapandiris.palette.SymmetricNormalizeinstances associated with the cube.Args:
- cube (
iris.cube.Cube): Source cube to generate default palette from.
- cube (
- Returns
Tuple of
matplotlib.colors.LinearSegmentedColormapandiris.palette.SymmetricNormalize
Notes
This function maintains laziness when called; it does not realise data. See more at Real and Lazy Data.