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:
Colormap.set_bad- usecmap.with_extremes(bad=...)insteadColormap.set_under- usecmap.with_extremes(under=...)insteadColormap.set_over- usecmap.with_extremes(over=...)insteadColormap.set_extremes- usecmap.with_extremes(...)instead
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).