Skip to content

Some more removals of deprecated APIs. #10926

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion doc/api/axes_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,6 @@ Property cycle
:nosignatures:

Axes.set_prop_cycle
Axes.set_color_cycle


Axis / limits
Expand Down
5 changes: 0 additions & 5 deletions doc/api/next_api_changes/2018-02-18-AL-removals.rst

This file was deleted.

6 changes: 3 additions & 3 deletions doc/api/next_api_changes/2018-02-26-AL-removals.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ The following deprecated API elements have been removed:
``cbook.recursive_remove``, ``cbook.unmasked_index_ranges``,
``cbook.Null``, ``cbook.RingBuffer``, ``cbook.Sorter``, ``cbook.Xlator``,
- ``font_manager.weight_as_number``, ``font_manager.ttfdict_to_fnames``,
- ``pyplot.colors``,
- ``pyplot.colors``, ``pyplot.spectral``,
- ``rcsetup.validate_negative_linestyle``,
``rcsetup.validate_negative_linestyle_legacy``,
- ``testing.compare.verifiers``, ``testing.compare.verify``,
- ``testing.decorators.knownfailureif``,
``testing.decorators.ImageComparisonTest.remove_text``,
- ``tests.assert_str_equal``, ``tests.test_tinypages.file_same``,
- ``texmanager.dvipng_hack_alpha``,
- ``_AxesBase.axesPatch``, ``_AxesBase.get_cursor_props``,
``_AxesBase.set_cursor_props``,
- ``_AxesBase.axesPatch``, ``_AxesBase.set_color_cycle``,
``_AxesBase.get_cursor_props``, ``_AxesBase.set_cursor_props``,
- ``_ImageBase.iterpnames``,
- ``FigureCanvasBase.start_event_loop_default``;
- ``FigureCanvasBase.stop_event_loop_default``;
Expand Down
18 changes: 0 additions & 18 deletions lib/matplotlib/axes/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1208,24 +1208,6 @@ def set_prop_cycle(self, *args, **kwargs):
self._get_lines.set_prop_cycle(prop_cycle)
self._get_patches_for_fill.set_prop_cycle(prop_cycle)

@cbook.deprecated('1.5', alternative='`.set_prop_cycle`')
def set_color_cycle(self, clist):
"""
Set the color cycle for any future plot commands on this Axes.

Parameters
----------
clist
A list of mpl color specifiers.
"""
if clist is None:
# Calling set_color_cycle() or set_prop_cycle() with None
# effectively resets the cycle, but you can't do
# set_prop_cycle('color', None). So we are special-casing this.
self.set_prop_cycle(None)
else:
self.set_prop_cycle('color', clist)

def get_aspect(self):
return self._aspect

Expand Down
24 changes: 0 additions & 24 deletions lib/matplotlib/pyplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -2069,7 +2069,6 @@ def colormaps():
gist_gray identical to *gray*
gist_yarg identical to *gray_r*
binary identical to *gray_r*
spectral identical to *nipy_spectral* [#]_
========= =======================================================

.. rubric:: Footnotes
Expand All @@ -2090,12 +2089,6 @@ def colormaps():
Color-Scale Images
<https://www.mathworks.com/matlabcentral/fileexchange/2662-cmrmap-m>`_
by Carey Rappaport

.. [#] Changed to distinguish from ColorBrewer's *Spectral* map.
:func:`spectral` still works, but
``set_cmap('nipy_spectral')`` is recommended for clarity.


"""
return sorted(cm.cmap_d)

Expand Down Expand Up @@ -3264,21 +3257,4 @@ def nipy_spectral():
"""
set_cmap("nipy_spectral")


# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
def spectral():
"""
Set the colormap to "spectral".

This changes the default colormap as well as the colormap of the current
image if there is one. See ``help(colormaps)`` for more information.
"""
from matplotlib.cbook import warn_deprecated
warn_deprecated(
"2.0",
name="spectral",
obj_type="colormap"
)
set_cmap("spectral")

_setup_pyplot_info_docstrings()
11 changes: 0 additions & 11 deletions lib/matplotlib/tests/test_cycles.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,17 +181,6 @@ def test_cycle_reset():
got = next(ax._get_lines.prop_cycler)
assert prop == got

fig, ax = plt.subplots()
# Need to double-check the old set/get_color_cycle(), too
with warnings.catch_warnings():
warnings.simplefilter("ignore", MatplotlibDeprecationWarning)
prop = next(ax._get_lines.prop_cycler)
ax.set_color_cycle(['c', 'm', 'y', 'k'])
assert prop != next(ax._get_lines.prop_cycler)
ax.set_color_cycle(None)
got = next(ax._get_lines.prop_cycler)
assert prop == got


def test_invalid_input_forms():
fig, ax = plt.subplots()
Expand Down
21 changes: 0 additions & 21 deletions tools/boilerplate.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,24 +71,6 @@ def {name}():

'''

CMAP_TEMPLATE_DEPRECATED = AUTOGEN_MSG + '''
def {name}():
"""
Set the colormap to "{name}".

This changes the default colormap as well as the colormap of the current
image if there is one. See ``help(colormaps)`` for more information.
"""
from matplotlib.cbook import warn_deprecated
warn_deprecated(
"2.0",
name="{name}",
obj_type="colormap"
)
set_cmap("{name}")

'''


def boilerplate_gen():
"""Generator of lines for the automated part of pyplot."""
Expand Down Expand Up @@ -308,12 +290,9 @@ def format_value(value):
'viridis',
"nipy_spectral"
)
deprecated_cmaps = ("spectral", )
# add all the colormaps (autumn, hsv, ....)
for name in cmaps:
yield CMAP_TEMPLATE.format(name=name)
for name in deprecated_cmaps:
yield CMAP_TEMPLATE_DEPRECATED.format(name=name)

yield ''
yield '_setup_pyplot_info_docstrings()'
Expand Down