matplotlib.colors.Norm#

classmatplotlib.colors.Norm[source]#

Bases:ABC

Abstract base class for normalizations.

Subclasses includeNormalize which maps from a scalar toa scalar. However, this class makes no such requirement, and subclasses maysupport the normalization of multiple variates simultaneously, withseparate normalization for each variate.

abstractmethod__call__(value,clip=None)[source]#

Normalize the data and return the normalized data.

Parameters:
value

Data to normalize.

clipbool, optional

See the description of the parameterclip inNormalize.

IfNone, defaults toself.clip (which defaults toFalse).

Notes

If not already initialized,self.vmin andself.vmax areinitialized usingself.autoscale_None(value).

abstractmethodautoscale(A)[source]#

Setvmin,vmax to min, max ofA.

abstractmethodautoscale_None(A)[source]#

Ifvmin orvmax are not set, use the min/max ofA to set them.

abstractpropertyclip#

Determines the behavior for mapping values outside the range[vmin,vmax].

See theclip parameter inNormalize.

abstractpropertyn_components#

The number of normalized components.

This is the number of elements of the parameter to__call__ and ofvmin,vmax.

abstractmethodscaled()[source]#

Return whethervmin andvmax are both set.

abstractpropertyvmax#

Upper limit of the input data interval; maps to 1.

abstractpropertyvmin#

Lower limit of the input data interval; maps to 0.

Examples usingmatplotlib.colors.Norm#

Histogram as colorbar

Histogram as colorbar

Colormap normalizations

Colormap normalizations

Colormap normalizations SymLogNorm

Colormap normalizations SymLogNorm

Contour image

Contour image

Annotated heatmap

Annotated heatmap

Image with masked values

Image with masked values

Blend transparency with color in 2D images

Blend transparency with color in 2D images

Multiple images with one colorbar

Multiple images with one colorbar

pcolor images

pcolor images

pcolormesh

pcolormesh

Mapping marker properties to multivariate data

Mapping marker properties to multivariate data

2D images in 3D

2D images in 3D

Exploring normalizations

Exploring normalizations

Shaded & power normalized rendering

Shaded & power normalized rendering

Hillshading

Hillshading

Left ventricle bullseye

Left ventricle bullseye

Histograms

Histograms

Constrained layout guide

Constrained layout guide

Customized Colorbars Tutorial

Customized Colorbars Tutorial

Colormap normalization

Colormap normalization

Quick start guide

Quick start guide