Skip to content

Commit 154082d

Browse files
committed
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).
1 parent 4c70e91 commit 154082d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/matplotlib/figure.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1867,7 +1867,8 @@ def text(self, x, y, s, fontdict=None, withdash=False, **kwargs):
18671867
"""
18681868
default = dict(transform=self.transFigure)
18691869

1870-
if withdash:
1870+
if (withdash
1871+
and withdash is not cbook.deprecation._deprecated_parameter):
18711872
text = TextWithDash(x=x, y=y, text=s)
18721873
else:
18731874
text = Text(x=x, y=y, text=s)

0 commit comments

Comments
 (0)