From a11fb24a334d9f9fe6dc833d169e704fff8c2eb9 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Mon, 25 Jan 2016 21:46:34 -0500 Subject: [PATCH] DOC: add function name to deprecation warning --- lib/matplotlib/artist.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/matplotlib/artist.py b/lib/matplotlib/artist.py index 83a238a3c239..1058c8bdaaba 100644 --- a/lib/matplotlib/artist.py +++ b/lib/matplotlib/artist.py @@ -207,7 +207,8 @@ def set_axes(self, axes): ACCEPTS: an :class:`~matplotlib.axes.Axes` instance """ - warnings.warn(_get_axes_msg, mplDeprecation, stacklevel=1) + warnings.warn(_get_axes_msg.format('set_axes'), mplDeprecation, + stacklevel=1) self.axes = axes def get_axes(self): @@ -218,7 +219,8 @@ def get_axes(self): This has been deprecated in mpl 1.5, please use the axes property. Will be removed in 1.7 or 2.0. """ - warnings.warn(_get_axes_msg, mplDeprecation, stacklevel=1) + warnings.warn(_get_axes_msg.format('get_axes'), mplDeprecation, + stacklevel=1) return self.axes @property @@ -1480,5 +1482,5 @@ def kwdoc(a): docstring.interpd.update(Artist=kwdoc(Artist)) -_get_axes_msg = """This has been deprecated in mpl 1.5, please use the +_get_axes_msg = """{} has been deprecated in mpl 1.5, please use the axes property. A removal date has not been set."""