MidpointNormalize

class mdtools.plot.MidpointNormalize(vmin=None, vmax=None, midpoint=None, clip=False)[source]

Class to define your own colorbar normalization.

Deprecated since version 0.0.0.dev0: Use matplotlib.colors.CenteredNorm or matplotlib.colors.TwoSlopeNorm instead.

Renormalizing a colorbar is for instance useful when you want that a diverging colorbar is centered at zero. Just parse norm = mdtplt.MidpointNormalize(midpoint=0.0) to the plotting function.

See Colormap Normalization for more information.

Initialize the Normalization.

Parameters:
  • vmin (float, optional) – The data value that defines 0.0 in the normalization. Defaults to the min value of the dataset.

  • vmax (float, optional) – The data value that defines 1.0 in the normalization. Defaults to the the max value of the dataset.

  • midpoint (float, optional) – The data value that defines 0.5 in the normalization.

  • clip (bool, optional) – This argument is without use!

Methods

autoscale

Set vmin, vmax to min, max of A.

autoscale_None

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

inverse

process_value

Homogenize the input value for easy and efficient normalization.

scaled

Return whether vmin and vmax are set.

Attributes

clip

vmax

vmin