Skip to content

Commit 37c5fe7

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 24caa1b commit 37c5fe7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/matplotlib/text.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2172,7 +2172,7 @@ def transform(renderer) -> Transform
21722172
xytext = self.xy
21732173
x, y = xytext
21742174

2175-
Text.__init__(self, x, y, text, **kwargs)
2175+
Text.__init__(self, x, y, text)
21762176

21772177
self.arrowprops = arrowprops
21782178

@@ -2193,6 +2193,9 @@ def transform(renderer) -> Transform
21932193
else:
21942194
self.arrow_patch = None
21952195

2196+
# Must come last, as some kwargs may be propagated to arrow_patch.
2197+
self.update(kwargs)
2198+
21962199
def contains(self, event):
21972200
inside, info = self._default_contains(event)
21982201
if inside is not None:

0 commit comments

Comments
 (0)