iris.palette

Load, configure and register color map palettes and initialise color map meta-data mappings.

In this module:

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.

↑ top ↑

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

↑ top ↑

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.

↑ top ↑

Provides a symmetric normalization class around a given pivot point.

class iris.palette.SymmetricNormalize(pivot, *args, **kwargs)[source]

Provides a symmetric normalization class around a given pivot point.

__call__(value, clip=None)

Normalize value data in the [vmin, vmax] interval into the [0.0, 1.0] interval and return it.

Parameters
  • value – Data to normalize.

  • clip (bool) – If None, defaults to self.clip (which defaults to False).

Notes

If not already initialized, self.vmin and self.vmax are initialized using self.autoscale_None(value).

autoscale(A)

Set vmin, vmax to min, max of A.

autoscale_None(A)

If vmin or vmax are not set, use the min/max of A to set them.

inverse(value)
static process_value(value)

Homogenize the input value for easy and efficient normalization.

value can be a scalar or sequence.

Returns

  • result (masked array) – Masked array with the same shape as value.

  • is_scalar (bool) – Whether value is a scalar.

Notes

Float dtypes are preserved; integer types with two bytes or smaller are converted to np.float32, and larger types are converted to np.float64. Preserving float32 when possible, and using in-place operations, greatly improves speed for large arrays.

scaled()

Return whether vmin and vmax are set.

property vmax
property vmin