diff --git a/doc/api/axes_api.rst b/doc/api/axes_api.rst index 30deeec7e62b..cfa3231b3593 100644 --- a/doc/api/axes_api.rst +++ b/doc/api/axes_api.rst @@ -229,7 +229,6 @@ Property cycle :nosignatures: Axes.set_prop_cycle - Axes.set_color_cycle Axis / limits diff --git a/doc/api/next_api_changes/2018-02-18-AL-removals.rst b/doc/api/next_api_changes/2018-02-18-AL-removals.rst deleted file mode 100644 index 6b094027a927..000000000000 --- a/doc/api/next_api_changes/2018-02-18-AL-removals.rst +++ /dev/null @@ -1,5 +0,0 @@ -Removal of deprecated functions -``````````````````````````````` -The following previously deprecated functions have been removed: -- ``matplotlib.font_manager.ttfdict_to_fnames`` -- ``matplotlib.font_manager.weight_as_number`` diff --git a/doc/api/next_api_changes/2018-02-26-AL-removals.rst b/doc/api/next_api_changes/2018-02-26-AL-removals.rst index 7eb15dcd381e..eb2cd5defb6f 100644 --- a/doc/api/next_api_changes/2018-02-26-AL-removals.rst +++ b/doc/api/next_api_changes/2018-02-26-AL-removals.rst @@ -15,7 +15,7 @@ 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``, @@ -23,8 +23,8 @@ The following deprecated API elements have been removed: ``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``; diff --git a/lib/matplotlib/axes/_base.py b/lib/matplotlib/axes/_base.py index 7046f871841d..b771474c585b 100644 --- a/lib/matplotlib/axes/_base.py +++ b/lib/matplotlib/axes/_base.py @@ -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 diff --git a/lib/matplotlib/pyplot.py b/lib/matplotlib/pyplot.py index cc49d7190a2c..4be01511e978 100644 --- a/lib/matplotlib/pyplot.py +++ b/lib/matplotlib/pyplot.py @@ -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 @@ -2090,12 +2089,6 @@ def colormaps(): Color-Scale Images `_ 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) @@ -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() diff --git a/lib/matplotlib/tests/test_cycles.py b/lib/matplotlib/tests/test_cycles.py index 95611f36c0e7..ac876ee7fa3c 100644 --- a/lib/matplotlib/tests/test_cycles.py +++ b/lib/matplotlib/tests/test_cycles.py @@ -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() diff --git a/tools/boilerplate.py b/tools/boilerplate.py index 21e66d4802e7..920fb9a95e52 100644 --- a/tools/boilerplate.py +++ b/tools/boilerplate.py @@ -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.""" @@ -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()'