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. 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):