@@ -243,43 +243,6 @@ def get_cmap(self, cmap):
243
243
_bivar_colormaps = ColormapRegistry (bivar_cmaps )
244
244
245
245
246
- # This is an exact copy of pyplot.get_cmap(). It was removed in 3.9, but apparently
247
- # caused more user trouble than expected. Re-added for 3.9.1 and extended the
248
- # deprecation period for two additional minor releases.
249
- @_api .deprecated (
250
- '3.7' ,
251
- removal = '3.11' ,
252
- alternative = "``matplotlib.colormaps[name]`` or ``matplotlib.colormaps.get_cmap()``"
253
- " or ``pyplot.get_cmap()``"
254
- )
255
- def get_cmap (name = None , lut = None ):
256
- """
257
- Get a colormap instance, defaulting to rc values if *name* is None.
258
-
259
- Parameters
260
- ----------
261
- name : `~matplotlib.colors.Colormap` or str or None, default: None
262
- If a `.Colormap` instance, it will be returned. Otherwise, the name of
263
- a colormap known to Matplotlib, which will be resampled by *lut*. The
264
- default, None, means :rc:`image.cmap`.
265
- lut : int or None, default: None
266
- If *name* is not already a Colormap instance and *lut* is not None, the
267
- colormap will be resampled to have *lut* entries in the lookup table.
268
-
269
- Returns
270
- -------
271
- Colormap
272
- """
273
- name = mpl ._val_or_rc (name , 'image.cmap' )
274
- if isinstance (name , colors .Colormap ):
275
- return name
276
- _api .check_in_list (sorted (_colormaps ), name = name )
277
- if lut is None :
278
- return _colormaps [name ]
279
- else :
280
- return _colormaps [name ].resampled (lut )
281
-
282
-
283
246
def _ensure_cmap (cmap ):
284
247
"""
285
248
Ensure that we have a `.Colormap` object.
0 commit comments