@@ -1734,27 +1734,23 @@ def transform(renderer) -> Transform
1734
1734
xytext = self .xy
1735
1735
x , y = xytext
1736
1736
1737
- Text .__init__ (self , x , y , text , ** kwargs )
1738
-
1739
1737
self .arrowprops = arrowprops
1740
-
1741
1738
if arrowprops is not None :
1739
+ arrowprops = arrowprops .copy ()
1742
1740
if "arrowstyle" in arrowprops :
1743
- arrowprops = self .arrowprops .copy ()
1744
1741
self ._arrow_relpos = arrowprops .pop ("relpos" , (0.5 , 0.5 ))
1745
1742
else :
1746
1743
# 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 )
1755
1748
else :
1756
1749
self .arrow_patch = None
1757
1750
1751
+ # Must come last, as some kwargs may be propagated to arrow_patch.
1752
+ Text .__init__ (self , x , y , text , ** kwargs )
1753
+
1758
1754
def contains (self , event ):
1759
1755
inside , info = self ._default_contains (event )
1760
1756
if inside is not None :
0 commit comments