Skip to content

Commit ddb644c

Browse files
committed
Some more removals of deprecated APIs.
Note that plt.spectral already raises an exception as of 2.2 anyways (the underlying colormap has already been removed).
1 parent f7b6f89 commit ddb644c

File tree

5 files changed

+3
-71
lines changed

5 files changed

+3
-71
lines changed

doc/api/next_api_changes/2018-02-18-AL-removals.rst

Lines changed: 0 additions & 5 deletions
This file was deleted.

doc/api/next_api_changes/2018-02-26-AL-removals.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ The following deprecated API elements have been removed:
1515
``cbook.recursive_remove``, ``cbook.unmasked_index_ranges``,
1616
``cbook.Null``, ``cbook.RingBuffer``, ``cbook.Sorter``, ``cbook.Xlator``,
1717
- ``font_manager.weight_as_number``, ``font_manager.ttfdict_to_fnames``,
18-
- ``pyplot.colors``,
18+
- ``pyplot.colors``, ``pyplot.spectral``,
1919
- ``rcsetup.validate_negative_linestyle``,
2020
``rcsetup.validate_negative_linestyle_legacy``,
2121
- ``testing.compare.verifiers``, ``testing.compare.verify``,
2222
- ``testing.decorators.knownfailureif``,
2323
``testing.decorators.ImageComparisonTest.remove_text``,
2424
- ``tests.assert_str_equal``, ``tests.test_tinypages.file_same``,
2525
- ``texmanager.dvipng_hack_alpha``,
26-
- ``_AxesBase.axesPatch``, ``_AxesBase.get_cursor_props``,
27-
``_AxesBase.set_cursor_props``,
26+
- ``_AxesBase.axesPatch``, ``_AxesBase.set_color_cycle``,
27+
``_AxesBase.get_cursor_props``, ``_AxesBase.set_cursor_props``,
2828
- ``_ImageBase.iterpnames``,
2929
- ``FigureCanvasBase.start_event_loop_default``;
3030
- ``FigureCanvasBase.stop_event_loop_default``;

lib/matplotlib/axes/_base.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,24 +1208,6 @@ def set_prop_cycle(self, *args, **kwargs):
12081208
self._get_lines.set_prop_cycle(prop_cycle)
12091209
self._get_patches_for_fill.set_prop_cycle(prop_cycle)
12101210

1211-
@cbook.deprecated('1.5', alternative='`.set_prop_cycle`')
1212-
def set_color_cycle(self, clist):
1213-
"""
1214-
Set the color cycle for any future plot commands on this Axes.
1215-
1216-
Parameters
1217-
----------
1218-
clist
1219-
A list of mpl color specifiers.
1220-
"""
1221-
if clist is None:
1222-
# Calling set_color_cycle() or set_prop_cycle() with None
1223-
# effectively resets the cycle, but you can't do
1224-
# set_prop_cycle('color', None). So we are special-casing this.
1225-
self.set_prop_cycle(None)
1226-
else:
1227-
self.set_prop_cycle('color', clist)
1228-
12291211
def get_aspect(self):
12301212
return self._aspect
12311213

lib/matplotlib/pyplot.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2069,7 +2069,6 @@ def colormaps():
20692069
gist_gray identical to *gray*
20702070
gist_yarg identical to *gray_r*
20712071
binary identical to *gray_r*
2072-
spectral identical to *nipy_spectral* [#]_
20732072
========= =======================================================
20742073
20752074
.. rubric:: Footnotes
@@ -2090,12 +2089,6 @@ def colormaps():
20902089
Color-Scale Images
20912090
<https://www.mathworks.com/matlabcentral/fileexchange/2662-cmrmap-m>`_
20922091
by Carey Rappaport
2093-
2094-
.. [#] Changed to distinguish from ColorBrewer's *Spectral* map.
2095-
:func:`spectral` still works, but
2096-
``set_cmap('nipy_spectral')`` is recommended for clarity.
2097-
2098-
20992092
"""
21002093
return sorted(cm.cmap_d)
21012094

@@ -3264,21 +3257,4 @@ def nipy_spectral():
32643257
"""
32653258
set_cmap("nipy_spectral")
32663259

3267-
3268-
# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
3269-
def spectral():
3270-
"""
3271-
Set the colormap to "spectral".
3272-
3273-
This changes the default colormap as well as the colormap of the current
3274-
image if there is one. See ``help(colormaps)`` for more information.
3275-
"""
3276-
from matplotlib.cbook import warn_deprecated
3277-
warn_deprecated(
3278-
"2.0",
3279-
name="spectral",
3280-
obj_type="colormap"
3281-
)
3282-
set_cmap("spectral")
3283-
32843260
_setup_pyplot_info_docstrings()

tools/boilerplate.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -71,24 +71,6 @@ def {name}():
7171
7272
'''
7373

74-
CMAP_TEMPLATE_DEPRECATED = AUTOGEN_MSG + '''
75-
def {name}():
76-
"""
77-
Set the colormap to "{name}".
78-
79-
This changes the default colormap as well as the colormap of the current
80-
image if there is one. See ``help(colormaps)`` for more information.
81-
"""
82-
from matplotlib.cbook import warn_deprecated
83-
warn_deprecated(
84-
"2.0",
85-
name="{name}",
86-
obj_type="colormap"
87-
)
88-
set_cmap("{name}")
89-
90-
'''
91-
9274

9375
def boilerplate_gen():
9476
"""Generator of lines for the automated part of pyplot."""
@@ -308,12 +290,9 @@ def format_value(value):
308290
'viridis',
309291
"nipy_spectral"
310292
)
311-
deprecated_cmaps = ("spectral", )
312293
# add all the colormaps (autumn, hsv, ....)
313294
for name in cmaps:
314295
yield CMAP_TEMPLATE.format(name=name)
315-
for name in deprecated_cmaps:
316-
yield CMAP_TEMPLATE_DEPRECATED.format(name=name)
317296

318297
yield ''
319298
yield '_setup_pyplot_info_docstrings()'

0 commit comments

Comments
 (0)