From 46738402197fe15391aa6723f476e5f6ca02ed9c Mon Sep 17 00:00:00 2001 From: "Joel B. Mohler" Date: Tue, 18 Nov 2014 11:23:09 -0500 Subject: [PATCH 1/2] insert deprecation warning for set_graylevel --- lib/matplotlib/backend_bases.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/matplotlib/backend_bases.py b/lib/matplotlib/backend_bases.py index 6cffc33613b6..209ec125a519 100644 --- a/lib/matplotlib/backend_bases.py +++ b/lib/matplotlib/backend_bases.py @@ -1011,6 +1011,11 @@ def set_graylevel(self, frac): """ Set the foreground color to be a gray level with *frac* """ + # When removing, remember to remove all overrides in subclasses. + msg = ("set_graylevel is deprecated for removal in 1.6; " + "you can achieve the same result by using " + "set_foreground((frac, frac, frac))") + warnings.warn(msg, mplDeprecation) self._rgb = (frac, frac, frac, self._alpha) def set_joinstyle(self, js): From d1fd40cadd0732f7ec55cae0b5fafa7d3fe84902 Mon Sep 17 00:00:00 2001 From: "Joel B. Mohler" Date: Tue, 18 Nov 2014 14:18:39 -0500 Subject: [PATCH 2/2] add documentation of graylevel deprecation --- doc/api/api_changes/2014-11-19_remove_set_graylevel.rst | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 doc/api/api_changes/2014-11-19_remove_set_graylevel.rst diff --git a/doc/api/api_changes/2014-11-19_remove_set_graylevel.rst b/doc/api/api_changes/2014-11-19_remove_set_graylevel.rst new file mode 100644 index 000000000000..b346a227c7c2 --- /dev/null +++ b/doc/api/api_changes/2014-11-19_remove_set_graylevel.rst @@ -0,0 +1,6 @@ +Deprecated `GraphicsContextBase.set_graylevel` +`````````````````````````````````````````````` + +The `GraphicsContextBase.set_graylevel` function has been deprecated in 1.5 and +will be removed in 1.6. It has been unused. The +`GraphicsContextBase.set_foreground` could be used instead.