@@ -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 if arrowprops is not None :
1739+ arrowprops = arrowprops .copy ()
17421740 if "arrowstyle" in arrowprops :
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- for key , val in self .arrowprops .items ():
1751- if key not in shapekeys :
1752- arrowprops [key ] = val # basic Patch properties
1753- self .arrow_patch = FancyArrowPatch ((0 , 0 ), (1 , 1 ),
1754- ** arrowprops )
1744+ for key in [
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 def contains (self , event ):
17591755 inside , info = self ._default_contains (event )
17601756 if inside is not None :
0 commit comments