diff --git a/lib/matplotlib/_cm.py b/lib/matplotlib/_cm.py index 2c229c879324..2ea33ed22ebe 100644 --- a/lib/matplotlib/_cm.py +++ b/lib/matplotlib/_cm.py @@ -1384,11 +1384,11 @@ def __getitem__(self, key): "Vega20b_r", "Vega20c", "Vega20c_r"]: warn_deprecated( "2.0", - name="Vega colormaps", - alternative="tab", + name=key, + alternative="tab" + key[4:], obj_type="colormap" ) - + return super(_deprecation_datad, self).__getitem__(key) diff --git a/lib/matplotlib/cm.py b/lib/matplotlib/cm.py index 0df436ab6d04..0384fa4cdc87 100644 --- a/lib/matplotlib/cm.py +++ b/lib/matplotlib/cm.py @@ -83,7 +83,8 @@ def _generate_cmap(name, lutsize): # Generate the reversed specifications ... for cmapname in list(six.iterkeys(datad)): - spec = datad[cmapname] + # Use superclass method to avoid deprecation warnings during initial load. + spec = dict.__getitem__(datad, cmapname) spec_reversed = _reverse_cmap_spec(spec) datad[cmapname + '_r'] = spec_reversed