matplotlib.colors.MultiNorm#

classmatplotlib.colors.MultiNorm(norms,vmin=None,vmax=None,clip=None)[source]#

Bases:Norm

A class which contains multiple scalar norms.

Parameters:
normslist of (str orNormalize)

The constituent norms. The list must have a minimum length of 1.

vmin, vmaxNone or list of (float or None)

Limits of the constituent norms.If a list, one value is assigned to each of the constituentnorms.If None, the limits of the constituent normsare not changed.

clipNone or list of bools, default: None

Determines the behavior for mapping values outside the range[vmin,vmax] for the constituent norms.If a list, each value is assigned to each of the constituentnorms.If None, the behaviour of the constituent norms is not changed.

__call__(values,clip=None)[source]#

Normalize the data and return the normalized data.

Each component of the input is normalized via the constituent norm.

Parameters:
valuesarray-like

The input data, as an iterable or a structured numpy array.

  • If iterable, must be of lengthn_components. Each element can be ascalar or array-like and is normalized through the corresponding norm.

  • If structured array, must haven_components fields. Each fieldis normalized through the corresponding norm.

cliplist of bools or None, optional

Determines the behavior for mapping values outside the range[vmin,vmax]. See the description of the parameterclip inNormalize.IfNone, defaults toself.clip (which defaults toFalse).

Returns:
tuple

Normalized input values

Notes

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

autoscale(A)[source]#

For each constituent norm, setvmin,vmax to min, max of the correspondingcomponent inA.

Parameters:
Aarray-like

The input data, as an iterable or a structured numpy array.

  • If iterable, must be of lengthn_components. Each elementis used for the limits of one constituent norm.

  • If structured array, must haven_components fields. Each fieldis used for the limits of one constituent norm.

autoscale_None(A)[source]#

Ifvmin orvmax are not set on any constituent norm,use the min/max of the corresponding component inA to set them.

Parameters:
Aarray-like

The input data, as an iterable or a structured numpy array.

  • If iterable, must be of lengthn_components. Each elementis used for the limits of one constituent norm.

  • If structured array, must haven_components fields. Each fieldis used for the limits of one constituent norm.

propertyclip#

The clip behaviour of each constituent norm.

inverse(values)[source]#

Map the normalized values (i.e., index in the colormap) back to data values.

Parameters:
valuesarray-like

The input data, as an iterable or a structured numpy array.

  • If iterable, must be of lengthn_components. Each element can be ascalar or array-like and is mapped through the corresponding norm.

  • If structured array, must haven_components fields. Each fieldis mapped through the the corresponding norm.

propertyn_components#

Number of norms held by thisMultiNorm.

propertynorms#

The individual norms held by thisMultiNorm.

scaled()[source]#

Return whether bothvmin andvmax are set on all constituent norms.

propertyvmax#

The upper limit of each constituent norm.

propertyvmin#

The lower limit of each constituent norm.