In-place modifications of colormaps#

Colormaps are planned to become immutable in the long term.

As a first step, in-place modifications of colormaps are now pending-deprecated. This affects the following methods of Colormap:

Use the respective Colormap.with_extremes and appropriate keyword arguments instead which returns a copy of the colormap (available since matplotlib 3.4). Alternatively, if you create the colormap yourself, you can also pass the respective arguments to the constructor (available since matplotlib 3.11).