Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8d31731

Browse files
committed
Work around TextWithDash not accepting all kwargs of Text
1 parent 2c54baa commit 8d31731

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -719,9 +719,10 @@ def text(self, x, y, s, fontdict=None, withdash=False, **kwargs):
719719
# a dash to TextWithDash and dashlength.
720720

721721
if withdash:
722-
t = mtext.TextWithDash(x, y, text=s, **effective_kwargs)
722+
t = mtext.TextWithDash(x, y, text=s)
723723
else:
724-
t = mtext.Text(x, y, text=s, **effective_kwargs)
724+
t = mtext.Text(x, y, text=s)
725+
t.update(effective_kwargs)
725726

726727
t.set_clip_path(self.patch)
727728
self._add_text(t)

lib/matplotlib/text.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1319,7 +1319,8 @@ def __init__(self,
13191319
multialignment=multialignment,
13201320
fontproperties=fontproperties,
13211321
rotation=rotation,
1322-
linespacing=linespacing)
1322+
linespacing=linespacing,
1323+
)
13231324

13241325
# The position (x,y) values for text and dashline
13251326
# are bogus as given in the instantiation; they will

0 commit comments

Comments
 (0)