From 154082d9bd871f3edffb4588fa73af5aac30ecd2 Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Tue, 7 May 2019 11:40:57 +0200 Subject: [PATCH] Fix deprecation of withdash for figtext(). Apply the same check for _deprecated_parameter in Figure.text() (aka plt.figtext()) as in Axes.text(). Otherwise any call to Figure.text(), even without passing withdash, emits a deprecation warning (because _deprecated_parameter is truthy). --- lib/matplotlib/figure.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/figure.py b/lib/matplotlib/figure.py index e74a3dac1e25..9c9bce18392e 100644 --- a/lib/matplotlib/figure.py +++ b/lib/matplotlib/figure.py @@ -1867,7 +1867,8 @@ def text(self, x, y, s, fontdict=None, withdash=False, **kwargs): """ default = dict(transform=self.transFigure) - if withdash: + if (withdash + and withdash is not cbook.deprecation._deprecated_parameter): text = TextWithDash(x=x, y=y, text=s) else: text = Text(x=x, y=y, text=s)