@@ -7,11 +7,12 @@ def demo_con_style(ax, connectionstyle):
7
7
family = "Source Code Pro" ,
8
8
transform = ax .transAxes , ha = "left" , va = "top" , size = "x-small" )
9
9
10
- fig , ax = plt .subplots (figsize = (4 , 2.5 ), frameon = False )
11
- ax .axis ("off" )
12
- for i ,style in enumerate (mpatches .ArrowStyle .get_styles ()):
13
- x0 , y0 = 5 + 5 * (i % 3 ), - (i // 3 )
14
- x1 , y1 = 1 + 5 * (i % 3 ), - (i // 3 )
10
+ (fig , axes ) = plt .subplots (5 , 3 , figsize = (4 , 2.5 ), frameon = False )
11
+ for ax in axes .flatten ():
12
+ ax .axis ("off" )
13
+ for i ,(ax ,style ) in enumerate (zip (axes .flatten (), mpatches .ArrowStyle .get_styles ())):
14
+ x0 , y0 = 0.8 , 0.5
15
+ x1 , y1 = 0.2 , 0.5
15
16
ax .plot ([x0 , x1 ], [y0 , y1 ], "." , color = "0.25" )
16
17
ax .annotate ("" ,
17
18
xy = (x0 , y0 ), xycoords = 'data' ,
@@ -22,6 +23,7 @@ def demo_con_style(ax, connectionstyle):
22
23
patchA = None , patchB = None ,
23
24
connectionstyle = "arc3,rad=0" ))
24
25
ax .text ( (x1 + x0 )/ 2 , y0 - 0.2 , style ,
26
+ transform = ax .transAxes ,
25
27
family = "Source Code Pro" , ha = "center" , va = "top" )
26
28
27
29
plt .savefig ("../figures/annotation-arrow-styles.pdf" )
0 commit comments