Skip to content

Improve deprecation documentation. Closes #7643 #7646

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 3 commits into from
Dec 20, 2016
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
9 changes: 9 additions & 0 deletions doc/api/api_changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
================

Expand Down
6 changes: 5 additions & 1 deletion lib/matplotlib/axes/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down Expand Up @@ -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
Expand Down
7 changes: 4 additions & 3 deletions lib/matplotlib/pyplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down