Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2ff579d

Browse files
authored
Merge pull request#15747 from anntzer/annotationinit
Move Text init to end of Annotation init.
2 parents7353ad9 +2f6eaf5 commit2ff579d

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

‎lib/matplotlib/text.py

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1734,27 +1734,23 @@ def transform(renderer) -> Transform
17341734
xytext=self.xy
17351735
x,y=xytext
17361736

1737-
Text.__init__(self,x,y,text,**kwargs)
1738-
17391737
self.arrowprops=arrowprops
1740-
17411738
ifarrowpropsisnotNone:
1739+
arrowprops=arrowprops.copy()
17421740
if"arrowstyle"inarrowprops:
1743-
arrowprops=self.arrowprops.copy()
17441741
self._arrow_relpos=arrowprops.pop("relpos", (0.5,0.5))
17451742
else:
17461743
# modified YAArrow API to be used with FancyArrowPatch
1747-
shapekeys= ('width','headwidth','headlength',
1748-
'shrink','frac')
1749-
arrowprops=dict()
1750-
forkey,valinself.arrowprops.items():
1751-
ifkeynotinshapekeys:
1752-
arrowprops[key]=val# basic Patch properties
1753-
self.arrow_patch=FancyArrowPatch((0,0), (1,1),
1754-
**arrowprops)
1744+
forkeyin [
1745+
'width','headwidth','headlength','shrink','frac']:
1746+
arrowprops.pop(key,None)
1747+
self.arrow_patch=FancyArrowPatch((0,0), (1,1),**arrowprops)
17551748
else:
17561749
self.arrow_patch=None
17571750

1751+
# Must come last, as some kwargs may be propagated to arrow_patch.
1752+
Text.__init__(self,x,y,text,**kwargs)
1753+
17581754
defcontains(self,event):
17591755
inside,info=self._default_contains(event)
17601756
ifinsideisnotNone:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp