10
10
11
11
12
12
fig = plt .figure (figsize = (4.25 , 4.25 * 95 / 115 ))
13
- ax = fig .add_axes ([0 ,0 , 1 , 1 ], frameon = False , aspect = 1 ,
14
- xlim = (0 - 5 ,100 + 10 ), ylim = (- 10 ,80 + 5 ), xticks = [], yticks = [])
13
+ ax = fig .add_axes ([0 , 0 , 1 , 1 ], frameon = False , aspect = 1 ,
14
+ xlim = (0 - 5 , 100 + 10 ), ylim = (- 10 , 80 + 5 ), xticks = [], yticks = [])
15
15
16
16
17
17
box = mpatches .FancyBboxPatch (
18
- (0 ,0 ), 100 , 83 , mpatches .BoxStyle ("Round" , pad = 0 , rounding_size = 2 ),
18
+ (0 , 0 ), 100 , 83 , mpatches .BoxStyle ("Round" , pad = 0 , rounding_size = 2 ),
19
19
linewidth = 1. , facecolor = "0.9" , edgecolor = "black" )
20
20
ax .add_artist (box )
21
21
22
22
box = mpatches .FancyBboxPatch (
23
- (0 ,0 ), 100 , 75 , mpatches .BoxStyle ("Round" , pad = 0 , rounding_size = 0 ),
23
+ (0 , 0 ), 100 , 75 , mpatches .BoxStyle ("Round" , pad = 0 , rounding_size = 0 ),
24
24
linewidth = 1. , facecolor = "white" , edgecolor = "black" )
25
25
ax .add_artist (box )
26
26
27
27
28
28
box = mpatches .Rectangle (
29
- (5 ,5 ), 45 , 30 , zorder = 10 ,
29
+ (5 , 5 ), 45 , 30 , zorder = 10 ,
30
30
linewidth = 1.0 , facecolor = "white" , edgecolor = "black" )
31
31
ax .add_artist (box )
32
32
33
33
box = mpatches .Rectangle (
34
- (5 ,40 ), 45 , 30 , zorder = 10 ,
34
+ (5 , 40 ), 45 , 30 , zorder = 10 ,
35
35
linewidth = 1.0 , facecolor = "white" , edgecolor = "black" )
36
36
ax .add_artist (box )
37
37
38
38
box = mpatches .Rectangle (
39
- (55 ,5 ), 40 , 65 , zorder = 10 ,
39
+ (55 , 5 ), 40 , 65 , zorder = 10 ,
40
40
linewidth = 1.0 , facecolor = "white" , edgecolor = "black" )
41
41
ax .add_artist (box )
42
42
43
43
# Window button
44
- X , Y = [5 ,10 ,15 ], [79 ,79 ,79 ]
45
- plt .scatter (X , Y , s = 75 , zorder = 10 ,
44
+ X , Y = [5 , 10 , 15 ], [79 , 79 , 79 ]
45
+ plt .scatter (X , Y , s = 75 , zorder = 10 ,
46
46
edgecolor = "black" , facecolor = "white" , linewidth = 1 )
47
47
48
48
60
60
plt .plot (X , Y , color = "black" , linestyle = ":" , linewidth = 1 , clip_on = False )
61
61
62
62
63
- def ext_arrow (p0 ,p1 ,p2 ,p3 ):
63
+ def ext_arrow (p0 , p1 , p2 , p3 ):
64
64
p0 , p1 = np .asarray (p0 ), np .asarray (p1 )
65
65
p2 , p3 = np .asarray (p2 ), np .asarray (p3 )
66
66
ax .arrow (* p0 , * (p1 - p0 ), zorder = 20 , linewidth = 0 ,
@@ -69,9 +69,10 @@ def ext_arrow(p0,p1,p2,p3):
69
69
ax .arrow (* p3 , * (p2 - p3 ), zorder = 20 , linewidth = 0 ,
70
70
length_includes_head = True , width = .4 ,
71
71
head_width = 2 , head_length = 2 , color = "black" )
72
- plt .plot ([p1 [0 ],p2 [0 ]], [p1 [1 ],p2 [1 ]], linewidth = .9 , color = "black" )
72
+ plt .plot ([p1 [0 ], p2 [0 ]], [p1 [1 ], p2 [1 ]], linewidth = .9 , color = "black" )
73
73
74
- def int_arrow (p0 ,p1 ):
74
+
75
+ def int_arrow (p0 , p1 ):
75
76
p0 , p1 = np .asarray (p0 ), np .asarray (p1 )
76
77
ax .arrow (* ((p0 + p1 )/ 2 ), * ((p1 - p0 )/ 2 ), zorder = 20 , linewidth = 0 ,
77
78
length_includes_head = True , width = .4 ,
@@ -81,48 +82,47 @@ def int_arrow(p0,p1):
81
82
head_width = 2 , head_length = 2 , color = "black" )
82
83
83
84
84
-
85
85
x = 0
86
86
y = 10
87
- ext_arrow ( (x - 4 ,y ), (x ,y ), (x + 5 ,y ), (x + 9 ,y ) )
87
+ ext_arrow ( (x - 4 , y ), (x , y ), (x + 5 , y ), (x + 9 , y ) )
88
88
ax .text (x + 9.5 , y , "left" , ha = "left" , va = "center" , size = "x-small" , zorder = 20 )
89
89
90
90
x += 50
91
- ext_arrow ( (x - 4 ,y ), (x ,y ), (x + 5 ,y ), (x + 9 ,y ) )
91
+ ext_arrow ( (x - 4 , y ), (x , y ), (x + 5 , y ), (x + 9 , y ) )
92
92
ax .text (x - 4.5 , y , "wspace" , ha = "right" , va = "center" , size = "x-small" , zorder = 20 )
93
93
94
94
x += 45
95
- ext_arrow ( (x - 4 ,y ), (x ,y ), (x + 5 ,y ), (x + 9 ,y ) )
95
+ ext_arrow ( (x - 4 , y ), (x , y ), (x + 5 , y ), (x + 9 , y ) )
96
96
ax .text (x - 4.5 , y , "right" , ha = "right" , va = "center" , size = "x-small" , zorder = 20 )
97
97
98
98
y = 0
99
99
x = 25
100
- ext_arrow ( (x ,y - 4 ), (x ,y ), (x ,y + 5 ), (x ,y + 9 ) )
100
+ ext_arrow ( (x , y - 4 ), (x , y ), (x , y + 5 ), (x , y + 9 ) )
101
101
ax .text (x , y + 9.5 , "bottom" , ha = "center" , va = "bottom" , size = "x-small" , zorder = 20 )
102
102
103
103
y += 35
104
- ext_arrow ( (x ,y - 4 ), (x ,y ), (x ,y + 5 ), (x ,y + 9 ) )
104
+ ext_arrow ( (x , y - 4 ), (x , y ), (x , y + 5 ), (x , y + 9 ) )
105
105
ax .text (x , y - 4.5 , "hspace" , ha = "center" , va = "top" , size = "x-small" , zorder = 20 )
106
106
107
107
y += 35
108
- ext_arrow ( (x ,y - 4 ), (x ,y ), (x ,y + 5 ), (x ,y + 9 ) )
108
+ ext_arrow ( (x , y - 4 ), (x , y ), (x , y + 5 ), (x , y + 9 ) )
109
109
ax .text (x , y - 4.5 , "top" , ha = "center" , va = "top" , size = "x-small" , zorder = 20 )
110
110
111
- int_arrow ((0 ,- 5 ), (100 ,- 5 ))
111
+ int_arrow ((0 , - 5 ), (100 , - 5 ))
112
112
ax .text (50 , - 5 , "figure width" , backgroundcolor = "white" , zorder = 30 ,
113
113
ha = "center" , va = "center" , size = "x-small" )
114
114
115
- int_arrow ((105 ,0 ), (105 ,75 ))
115
+ int_arrow ((105 , 0 ), (105 , 75 ))
116
116
ax .text (105 , 75 / 2 , "figure height" , backgroundcolor = "white" , zorder = 30 ,
117
- rotation = "vertical" , ha = "center" , va = "center" , size = "x-small" )
117
+ rotation = "vertical" , ha = "center" , va = "center" , size = "x-small" )
118
118
119
- int_arrow ((55 ,62.5 ), (95 ,62.5 ))
119
+ int_arrow ((55 , 62.5 ), (95 , 62.5 ))
120
120
ax .text (75 , 62.5 , "axes width" , backgroundcolor = "white" , zorder = 30 ,
121
121
ha = "center" , va = "center" , size = "x-small" )
122
122
123
- int_arrow ((62.5 ,5 ), (62.5 ,70 ))
123
+ int_arrow ((62.5 , 5 ), (62.5 , 70 ))
124
124
ax .text (62.5 , 35 , "axes height" , backgroundcolor = "white" , zorder = 30 ,
125
- rotation = "vertical" , ha = "center" , va = "center" , size = "x-small" )
125
+ rotation = "vertical" , ha = "center" , va = "center" , size = "x-small" )
126
126
127
127
128
128
plt .savefig ("../figures/adjustments.pdf" )
0 commit comments