Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c34ddc4

Browse files
authored
Merge pull request #7646 from data-exp-lab/improve-depr
DOC: Improve deprecation documentation (hold and spectral) Closes #7643
2 parents a889cff + b0618d8 commit c34ddc4

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

doc/api/api_changes.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,15 @@ figure which is raising an error on draw. The previous behavior would only mark
192192
a figure as not stale after a full re-draw succeeded.
193193

194194

195+
The spectral colormap is now nipy_spectral
196+
------------------------------------------
197+
198+
The colormaps formerly known as ``spectral`` and ``spectral_r`` have been
199+
replaced by ``nipy_spectral`` and ``nipy_spectral_r`` since matplotlib
200+
1.3.0. Even though the colormap was deprecated in matplotlib 1.3.0, it never
201+
raised a warning. As of matplotlib 2.0.0, using the old names raises a
202+
deprecation warning. In the future, using the old names will raise an error.
203+
195204
Changes in 1.5.3
196205
================
197206

lib/matplotlib/axes/_base.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@
4242
is_string_like = cbook.is_string_like
4343
is_sequence_of_strings = cbook.is_sequence_of_strings
4444

45+
_hold_msg = """axes.hold is deprecated.
46+
See the API Changes document (http://matplotlib.org/api/api_changes.html)
47+
for more details."""
48+
4549

4650
def _process_plot_format(fmt):
4751
"""
@@ -1202,7 +1206,7 @@ def ishold(self):
12021206

12031207
return self._hold
12041208

1205-
@cbook.deprecated("2.0")
1209+
@cbook.deprecated("2.0", message=_hold_msg)
12061210
def hold(self, b=None):
12071211
"""
12081212
Set the hold state

lib/matplotlib/pyplot.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -775,9 +775,10 @@ def figlegend(handles, labels, loc, **kwargs):
775775

776776
## Figure and Axes hybrid ##
777777

778-
_hold_msg = """Future behavior will be consistent with the long-time
779-
default: plot commands add elements without first
780-
clearing the Axes and/or Figure."""
778+
_hold_msg = """pyplot.hold is deprecated.
779+
Future behavior will be consistent with the long-time default:
780+
plot commands add elements without first clearing the
781+
Axes and/or Figure."""
781782

782783
@deprecated("2.0", message=_hold_msg)
783784
def hold(b=None):

0 commit comments

Comments
 (0)