From 49ed95d167ee5bbe7bd5520487e717ce82527322 Mon Sep 17 00:00:00 2001 From: Nathan Goldbaum Date: Mon, 19 Dec 2016 21:41:31 -0600 Subject: [PATCH 1/3] Tweak the deprecation warning for pyplot.hold --- lib/matplotlib/pyplot.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/matplotlib/pyplot.py b/lib/matplotlib/pyplot.py index 5e7f8e1b22f7..534887362a81 100644 --- a/lib/matplotlib/pyplot.py +++ b/lib/matplotlib/pyplot.py @@ -775,9 +775,10 @@ def figlegend(handles, labels, loc, **kwargs): ## Figure and Axes hybrid ## -_hold_msg = """Future behavior will be consistent with the long-time - default: plot commands add elements without first - clearing the Axes and/or Figure.""" +_hold_msg = """pyplot.hold is deprecated. + Future behavior will be consistent with the long-time default: + plot commands add elements without first clearing the + Axes and/or Figure.""" @deprecated("2.0", message=_hold_msg) def hold(b=None): From 9af29900b318f7bbc3dcf03e05ae65f5fd20b40e Mon Sep 17 00:00:00 2001 From: Nathan Goldbaum Date: Mon, 19 Dec 2016 21:41:48 -0600 Subject: [PATCH 2/3] Improve the deprecation warning for axes.hold --- lib/matplotlib/axes/_base.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/axes/_base.py b/lib/matplotlib/axes/_base.py index 7e7dfcc3c1c7..669f72030f7a 100644 --- a/lib/matplotlib/axes/_base.py +++ b/lib/matplotlib/axes/_base.py @@ -42,6 +42,10 @@ is_string_like = cbook.is_string_like is_sequence_of_strings = cbook.is_sequence_of_strings +_hold_msg = """axes.hold is deprecated. + See the API Changes document (http://matplotlib.org/api/api_changes.html) + for more details.""" + def _process_plot_format(fmt): """ @@ -1202,7 +1206,7 @@ def ishold(self): return self._hold - @cbook.deprecated("2.0") + @cbook.deprecated("2.0", message=_hold_msg) def hold(self, b=None): """ Set the hold state From b0618d8a58cd320f58fda49d34e06e7251c98e0a Mon Sep 17 00:00:00 2001 From: Nathan Goldbaum Date: Mon, 19 Dec 2016 21:42:02 -0600 Subject: [PATCH 3/3] Mention the deprecation of the spectral colormap in the api_changes doc --- doc/api/api_changes.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/doc/api/api_changes.rst b/doc/api/api_changes.rst index 7ec22368c975..b84a54be2e5b 100644 --- a/doc/api/api_changes.rst +++ b/doc/api/api_changes.rst @@ -192,6 +192,15 @@ figure which is raising an error on draw. The previous behavior would only mark a figure as not stale after a full re-draw succeeded. +The spectral colormap is now nipy_spectral +------------------------------------------ + +The colormaps formerly known as ``spectral`` and ``spectral_r`` have been +replaced by ``nipy_spectral`` and ``nipy_spectral_r`` since matplotlib +1.3.0. Even though the colormap was deprecated in matplotlib 1.3.0, it never +raised a warning. As of matplotlib 2.0.0, using the old names raises a +deprecation warning. In the future, using the old names will raise an error. + Changes in 1.5.3 ================