You are viewing the latest unreleased documentation 3.1.0.dev453. You can switch to a stable version.

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: 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]#

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

Parameters:

cube (iris.cube.Cube) – Source cube to generate default palette from.

Returns:

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

Return type:

tuple

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.

Parameters:

cmap – The color map instance.

Return type:

bool