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

Skip to content

Commit 124812f

Browse files
committed
Move Text kwargs init to end of Annotation init.
... in case some kwargs (each of which is handled by calling a set_foo) need to refer to arrow_patch.
1 parent a0eb716 commit 124812f

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

lib/matplotlib/text.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1764,8 +1764,6 @@ def transform(renderer) -> Transform
17641764
xytext = self.xy
17651765
x, y = xytext
17661766

1767-
Text.__init__(self, x, y, text, **kwargs)
1768-
17691767
self.arrowprops = arrowprops
17701768

17711769
if arrowprops is not None:
@@ -1785,6 +1783,9 @@ def transform(renderer) -> Transform
17851783
else:
17861784
self.arrow_patch = None
17871785

1786+
# Must come last, as some kwargs may be propagated to arrow_patch.
1787+
Text.__init__(self, x, y, text, **kwargs)
1788+
17881789
def contains(self, event):
17891790
inside, info = self._default_contains(event)
17901791
if inside is not None:

0 commit comments

Comments
 (0)