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: Normalize

Provides 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) calls autoscale_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) calls autoscale_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 True values 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]#

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.LinearSegmentedColormap and iris.palette.SymmetricNormalize instances associated with the cube.

Args:

Returns:

Tuple of matplotlib.colors.LinearSegmentedColormap and iris.palette.SymmetricNormalize

Notes

This function maintains laziness when called; it does not realise data. See more at Real and Lazy Data.

iris.palette.is_brewer(cmap)[source]#

Determine whether the color map is a Cynthia Brewer color map.

Args:

  • cmap:

    The color map instance.

Returns:

Boolean.