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

Skip to content

Commit 848fa10

Browse files
committed
Work around TextWithDash not accepting all kwargs of Text
1 parent a34c617 commit 848fa10

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
@@ -712,9 +712,10 @@ def text(self, x, y, s, fontdict=None, withdash=False, **kwargs):
712712
# a dash to TextWithDash and dashlength.
713713

714714
if withdash:
715-
t = mtext.TextWithDash(x, y, text=s, **effective_kwargs)
715+
t = mtext.TextWithDash(x, y, text=s)
716716
else:
717-
t = mtext.Text(x, y, text=s, **effective_kwargs)
717+
t = mtext.Text(x, y, text=s)
718+
t.update(effective_kwargs)
718719

719720
t.set_clip_path(self.patch)
720721
self._add_text(t)

lib/matplotlib/text.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1363,7 +1363,8 @@ def __init__(self,
13631363
multialignment=multialignment,
13641364
fontproperties=fontproperties,
13651365
rotation=rotation,
1366-
linespacing=linespacing)
1366+
linespacing=linespacing,
1367+
)
13671368

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

0 commit comments

Comments
 (0)