The syntax you're using is completely different to the one in the linked documentation. There is essentially no difference between normalizing a scatter or a pcolor(mesh) or just any other scalar mappable object.

It's always

colormap = plt.cm.bwr #or any other colormap
normalize = matplotlib.colors.Normalize(vmin=-1, vmax=1)
plt.scatter(x, y, c=z, s=5, cmap=colormap, norm=normalize, marker='*')
Answer from ImportanceOfBeingErnest on Stack Overflow
🌐
Matplotlib
matplotlib.org › stable › users › explain › colors › colormapnorms.html
Colormap normalization — Matplotlib 3.11.2 documentation
will map the data in Z linearly from -1 to +1, so Z=0 will give a color at the center of the colormap RdBu_r (white in this case). Matplotlib does this mapping in two steps, with a normalization from the input data to [0, 1] occurring first, and then mapping onto the indices in the colormap.
🌐
Matplotlib
matplotlib.org › 2.0.2 › users › colormapnorms.html
Colormap Normalization — Matplotlib 2.0.2 documentation
For this we use the colors.PowerNorm(). It takes as an argument gamma (gamma == 1.0 will just yield the default linear normalization): ... There should probably be a good reason for plotting the data using this type of transformation. Technical viewers are used to linear and logarithmic axes and data transformations. Power laws are less common, and viewers should explicitly be made aware that they have been used. """ Demonstration of using norm to map colormaps onto data in non-linear ways. """ import numpy as np import matplotlib.pyplot as plt import matplotlib.colors as colors from matplotlib.mlab import bivariate_normal N = 100 X, Y = np.mgrid[-3:3:complex(0, N), -2:2:complex(0, N)] ''' PowerNorm: Here a power-law trend in X partially obscures a rectified sine wave in Y.
🌐
Matplotlib
matplotlib.org › stable › gallery › images_contours_and_fields › colormap_normalizations.html
Colormap normalizations — Matplotlib 3.11.2 documentation
fig, ax = plt.subplots(3, 1, layout='constrained') pcm = ax[0].pcolormesh(X, Y, Z, cmap='RdBu_r', shading='nearest', vmin=-np.max(Z)) fig.colorbar(pcm, ax=ax[0], extend='both', orientation='vertical', label='linear scaling') # Evenly-spaced bounds gives a contour-like effect. bounds = np.linspace(-2, 2, 11) norm = colors.BoundaryNorm(boundaries=bounds, ncolors=256) pcm = ax[1].pcolormesh(X, Y, Z, cmap='RdBu_r', shading='nearest', norm=norm) fig.colorbar(pcm, ax=ax[1], extend='both', orientation='vertical', label='BoundaryNorm\nlinspace(-2, 2, 11)') # Unevenly-spaced bounds changes the colormapping.
🌐
Matplotlib
matplotlib.org › 2.1.0 › tutorials › colors › colormapnorms.html
Colormap Normalization — Matplotlib 2.1.0 documentation
In [1]: import matplotlib as mpl In [2]: norm = mpl.colors.Normalize(vmin=-1.,vmax=1.) In [3]: norm(0.) Out[3]: 0.5 · However, there are sometimes cases where it is useful to map data to colormaps in a non-linear fashion.
🌐
TutorialsPoint
tutorialspoint.com › matplotlib › matplotlib_colormap_normalization.htm
Matplotlib - ColorMap Normalization
The TwoSlopeNorm normalization is used when different colormaps on either side of a conceptual center point, it is commonly used in scenarios such as topographic maps where land and ocean have different elevation and depth ranges. When built-in norms fall short, then the FuncNorm enables custom normalization using arbitrary functions. Additionally, Matplotlib supports crafting custom normalizations like MidpointNormalize, useful for defining mappings in specialized visualizations.
🌐
Matplotlib
matplotlib.org › 3.1.1 › tutorials › colors › colormapnorms.html
Colormap Normalization — Matplotlib 3.1.2 documentation
May 1, 2020 - In [1]: import matplotlib as mpl In [2]: norm = mpl.colors.Normalize(vmin=-1.,vmax=1.) In [3]: norm(0.) Out[3]: 0.5 · However, there are sometimes cases where it is useful to map data to colormaps in a non-linear fashion.
🌐
Matplotlib
matplotlib.org › 2.1.1 › tutorials › colors › colormapnorms.html
Colormap Normalization — Matplotlib 2.1.1 documentation
In [1]: import matplotlib as mpl In [2]: norm = mpl.colors.Normalize(vmin=-1.,vmax=1.) In [3]: norm(0.) Out[3]: 0.5 · However, there are sometimes cases where it is useful to map data to colormaps in a non-linear fashion.
Find elsewhere
🌐
Matplotlib
matplotlib.org › 3.1.0 › tutorials › colors › colormapnorms.html
Colormap Normalization — Matplotlib 3.1.0 documentation
In [1]: import matplotlib as mpl In [2]: norm = mpl.colors.Normalize(vmin=-1.,vmax=1.) In [3]: norm(0.) Out[3]: 0.5 · However, there are sometimes cases where it is useful to map data to colormaps in a non-linear fashion.
🌐
Matplotlib
matplotlib.org › 2.0.0 › users › colormapnorms.html
Colormap Normalization — Matplotlib 2.0.0 documentation
For this we use the colors.PowerNorm(). It takes as an argument gamma (gamma == 1.0 will just yield the default linear normalization): ... There should probably be a good reason for plotting the data using this type of transformation. Technical viewers are used to linear and logarithmic axes and data transformations. Power laws are less common, and viewers should explicitly be made aware that they have been used. """ Demonstration of using norm to map colormaps onto data in non-linear ways. """ import numpy as np import matplotlib.pyplot as plt import matplotlib.colors as colors from matplotlib.mlab import bivariate_normal N = 100 X, Y = np.mgrid[-3:3:complex(0, N), -2:2:complex(0, N)] ''' PowerNorm: Here a power-law trend in X partially obscures a rectified sine wave in Y.
🌐
Matplotlib
matplotlib.org › 2.1.2 › tutorials › colors › colormapnorms.html
Colormap Normalization — Matplotlib 2.1.2 documentation
In [1]: import matplotlib as mpl In [2]: norm = mpl.colors.Normalize(vmin=-1.,vmax=1.) In [3]: norm(0.) Out[3]: 0.5 · However, there are sometimes cases where it is useful to map data to colormaps in a non-linear fashion.
🌐
Matplotlib
matplotlib.org › stable › tutorials › colors › colormapnorms.html
Matplotlib
August 13, 2021 - Matplotlib has support for visualizing information with a wide array of colors and colormaps.
🌐
GeeksforGeeks
geeksforgeeks.org › matplotlib-colors-normalize-class-in-python
Matplotlib.colors.Normalize class in Python | GeeksforGeeks
April 28, 2025 - The matplotlib.colors module is used for converting color or numbers arguments to RGBA or RGB.This module is used for mapping numbers to colors or color specification conversion in a 1-D array of colors also known as colormap.
🌐
Matplotlib
matplotlib.org › 3.4.1 › tutorials › colors › colormapnorms.html
Colormap Normalization — Matplotlib 3.4.1 documentation
In [1]: import matplotlib as mpl In [2]: norm = mpl.colors.Normalize(vmin=-1, vmax=1) In [3]: norm(0) Out[3]: 0.5 · However, there are sometimes cases where it is useful to map data to colormaps in a non-linear fashion.
🌐
Matplotlib
matplotlib.org › 3.5.1 › tutorials › colors › colormapnorms.html
Colormap Normalization — Matplotlib 3.5.1 documentation
In [1]: import matplotlib as mpl In [2]: norm = mpl.colors.Normalize(vmin=-1, vmax=1) In [3]: norm(0) Out[3]: 0.5 · However, there are sometimes cases where it is useful to map data to colormaps in a non-linear fashion.
🌐
Mines-paristech
members.cbio.mines-paristech.fr › ~nvaroquaux › tmp › matplotlib › users › colormapnorms.html
Colormap Normalization — Matplotlib 2.0.0b4.post2415.dev0+g315f2c9 documentation
For this we use the colors.PowerNorm(). It takes as an argument gamma (gamma == 1.0 will just yield the default linear normalization): ... There should probably be a good reason for plotting the data using this type of transformation. Technical viewers are used to linear and logarithmic axes and data transformations. Power laws are less common, and viewers should explicitly be made aware that they have been used. """ Demonstration of using norm to map colormaps onto data in non-linear ways. """ import numpy as np import matplotlib.pyplot as plt import matplotlib.colors as colors from matplotlib.mlab import bivariate_normal N = 100 X, Y = np.mgrid[-3:3:complex(0, N), -2:2:complex(0, N)] ''' PowerNorm: Here a power-law trend in X partially obscures a rectified sine wave in Y.
🌐
Matplotlib
matplotlib.org › 3.5.0 › tutorials › colors › colormapnorms.html
Colormap Normalization — Matplotlib 3.5.0 documentation
July 17, 2020 - In [1]: import matplotlib as mpl In [2]: norm = mpl.colors.Normalize(vmin=-1, vmax=1) In [3]: norm(0) Out[3]: 0.5 · However, there are sometimes cases where it is useful to map data to colormaps in a non-linear fashion.
🌐
LabEx
labex.io › tutorials › matplotlib-colormap-normalization-48611
Matplotlib Colormap Normalization: Visualizing Nonlinear Data | LabEx
In such cases, colormap normalization can be used to map colormaps onto data in nonlinear ways to help visualize the data more accurately. Matplotlib provides several normalization methods, including SymLogNorm and AsinhNorm, which can be used ...
🌐
Matplotlib
matplotlib.org › 3.10.7 › users › explain › colors › colormapnorms.html
Colormap normalization — Matplotlib 3.10.7 documentation
will map the data in Z linearly from -1 to +1, so Z=0 will give a color at the center of the colormap RdBu_r (white in this case). Matplotlib does this mapping in two steps, with a normalization from the input data to [0, 1] occurring first, and then mapping onto the indices in the colormap.