matplotlib.colors.SymLogNorm#

classmatplotlib.colors.SymLogNorm(linthresh,linscale=1.0,vmin=None,vmax=None,clip=False,*,base=10)[source]#

Bases:SymLogNorm

The symmetrical logarithmic scale is logarithmic in both thepositive and negative directions from the origin.

Since the values close to zero tend toward infinity, there is aneed to have a range around zero that is linear. The parameterlinthresh allows the user to specify the size of this range(-linthresh,linthresh).

Parameters:
linthreshfloat

The range within which the plot is linear (to avoid having the plotgo to infinity around zero).

linscalefloat, default: 1

This allows the linear range (-linthresh tolinthresh) to bestretched relative to the logarithmic range. Its value is thenumber of decades to use for each half of the linear range. Forexample, whenlinscale == 1.0 (the default), the space used forthe positive and negative halves of the linear range will be equalto one decade in the logarithmic range.

basefloat, default: 10
Parameters:
vmin, vmaxfloat or None

Values within the range[vmin,vmax] from the input data will belinearly mapped to[0,1]. If eithervmin orvmax is notprovided, they default to the minimum and maximum values of the input,respectively.

clipbool, default: False

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

If clipping is off, values outside the range[vmin,vmax] arealso transformed, resulting in values outside[0,1]. Thisbehavior is usually desirable, as colormaps can mark theseunderandover values with specific colors.

If clipping is on, values belowvmin are mapped to 0 and valuesabovevmax are mapped to 1. Such values become indistinguishablefrom regular boundary values, which may cause misinterpretation ofthe data.

Notes

Ifvmin==vmax, input data will be mapped to 0.

__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).

autoscale_None(A)[source]#

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

inverse(value)[source]#

Maps the normalized value (i.e., index in the colormap) back to imagedata value.

Parameters:
value

Normalized value.

Examples usingmatplotlib.colors.SymLogNorm#

Colormap normalizations

Colormap normalizations

Colormap normalizations SymLogNorm

Colormap normalizations SymLogNorm

Colormap normalization

Colormap normalization