@@ -69,7 +69,7 @@ class AngleMarker(Arc):
69
69
Draws an arc between two vectors which appears circular in display space.
70
70
"""
71
71
def __init__ (self , xy , p1 , p2 , size = 75 , unit = "points" , ax = None ,
72
- text = "" , textposition = "inside" , text_kw = {} , ** kwargs ):
72
+ text = "" , textposition = "inside" , text_kw = None , ** kwargs ):
73
73
"""
74
74
Parameters
75
75
----------
@@ -124,11 +124,11 @@ def __init__(self, xy, p1, p2, size=75, unit="points", ax=None,
124
124
self .ax .add_patch (self )
125
125
126
126
self .kw = dict (ha = "center" , va = "center" ,
127
- xycoords = IdentityTransform (), xytext = ( 0 , 0 ),
128
- textcoords = "offset points" )
129
- self . kw . update ( text_kw )
130
- self .text = ax . annotate ( text , xy = self . _center ,
131
- ** self .kw )
127
+ xycoords = IdentityTransform (),
128
+ xytext = ( 0 , 0 ), textcoords = "offset points" ,
129
+ annotation_clip = True )
130
+ self .kw . update ( text_kw or {})
131
+ self . text = ax . annotate ( text , xy = self . _center , ** self .kw )
132
132
133
133
def get_size (self ):
134
134
factor = 1.
@@ -280,7 +280,8 @@ def plot_angle(ax, pos, angle, length=0.95, acol="C0", **kwargs):
280
280
for x , text in zip ([2.0 , 3.5 , 5.0 , 6.5 ], ['"inside"' , '"outside"' , '"edge"' ,
281
281
'"edge", custom arrow' ]):
282
282
ax2 .annotate (text , xy = (x , 0 ), xycoords = ax2 .get_xaxis_transform (),
283
- bbox = dict (boxstyle = "round" , fc = "w" ), ha = "left" , fontsize = 8 )
283
+ bbox = dict (boxstyle = "round" , fc = "w" ), ha = "left" , fontsize = 8 ,
284
+ annotation_clip = True )
284
285
285
286
#### SUBPLOT 3 ####
286
287
# Showcase different size units. The effect of this can best be observed
@@ -297,7 +298,8 @@ def plot_angle(ax, pos, angle, length=0.95, acol="C0", **kwargs):
297
298
for x , text in zip ([2.0 , 3.5 , 5.0 , 6.5 ], ['"pixels"' , '"points"' ,
298
299
'"axes min"' , '"axes max"' ]):
299
300
ax3 .annotate (text , xy = (x , 0 ), xycoords = ax3 .get_xaxis_transform (),
300
- bbox = dict (boxstyle = "round" , fc = "w" ), ha = "left" , fontsize = 8 )
301
+ bbox = dict (boxstyle = "round" , fc = "w" ), ha = "left" , fontsize = 8 ,
302
+ annotation_clip = True )
301
303
302
304
plt .show ()
303
305
0 commit comments