-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathWED-A_Fig_4.sh
executable file
·241 lines (240 loc) · 6.28 KB
/
WED-A_Fig_4.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
#!/usr/bin/env bash
#
# Figure 4 in this paper: WED-A_Fig_4.sh
# https://github.com/GenericMappingTools/gmt-2024-animation
#
# Wessel, Esteban & Delaviel-Anger, 2024,
# The Generic Mapping Tools and Animations for the Masses,
# Geochem. Geophys. Geosyst.
#
# Purpose: Show plot of the six movie progress indicators available.
#--------------------------------------------------------------------------------
NAME=WED-A_Fig_4
gmt begin ${NAME} png
gmt set GMT_THEME cookbook
gmt set FONT_LABEL 12p
gmt subplot begin 5x1 -Fs15c/4c -A
# SIZE
cat <<- EOF > Custom_annoLine.txt
-0.5 afg t@-r@-
0 afg t@-b@-
0.6 afg t@-p@-
1.5 afg t@-d@-
3 afg t@-e@-
3.5 afg t@-f@-
EOF
# Rise (t = -0.5 to 0 symbol size goes from 0 to 5x)
gmt math -T-0.5/0/0.02 T 0.5 ADD 2 MUL 2 POW 5 MUL = Line.txt
# plateau (t = 0 to 0.5 symbol size stays at 5x)
gmt math -T0/0.6/0.1 5 = >> Line.txt
# Decay (t = 0.5 to 1.5 symbol size decays from 5x to 1x)
gmt math -T0.6/1.5/0.02 0.9 T 0.6 SUB SUB 0.9 DIV 2 POW 4 MUL 1 ADD = >> Line.txt
# active (t = 1.5 to 3 symbol size stays at 1x)
gmt math -T1.5/3/0.1 1 = >> Line.txt
# Fade (t = 3 to 3.5 symbol size linearly drops to 0.3 during fading)
gmt math -T3/3.5/0.1 T 3 SUB 1.4 MUL NEG 1 ADD = >> Line.txt
# Code (t = 3.5 5 symbol size stays at 0.3 during code)
gmt math -T3.5/5/0.1 0.3 = >> Line.txt
gmt basemap -R-1/5/-1/6.5 -BWStr -BxcCustom_annoLine.txt -Byag10+l"Symbol magnification" -c
gmt plot -W3p,green <<- EOF -lDefault
-1 0
0 0
0 1
3 1
3 0
5 0
EOF
gmt plot -W0.25p,- <<- EOF
-1 1
6 1
EOF
gmt plot -W2p Line.txt -lAnnounce
gmt plot -Sv12p+bt+et+s -W1.5p,red <<- EOF
-0.5 5.5 1.5 5.5
EOF
gmt plot -Sv12p+bt+et+s -W1.5p,blue <<- EOF
0 6 3 6
EOF
gmt plot -St12p -Gblue <<- EOF
0 -0.9
3 -0.9
EOF
gmt text -F+f9p -Gwhite <<- EOF
-0.25 -0.4 RISE
0.3 -0.4 PLATEAU
1 -0.4 DECAY
2.25 -0.4 NORMAL
3.25 -0.4 FADE
4.25 -0.4 CODA
0.5 5.5 ANNOUNCE
1.5 6 DURATION OF EVENT
EOF
# INTENSITY
# Rise (t = -0.5 to 0 intensity goes from 0 to 4)
gmt math -T-0.5/0/0.02 T 0.5 ADD 2 MUL 2 POW 4 MUL = Line.txt
# plateau (t = 0 to 0.6 intensity stays at 4)
gmt math -T0/0.6/0.1 4 = >> Line.txt
# Decay (t = 0.6 to 1.5 intensity decays from 4 to 0)
gmt math -T0.6/1.5/0.02 0.9 T 0.6 SUB SUB 0.9 DIV 2 POW 4 MUL = >> Line.txt
# active (t = 1.5 to 3 intensity stays at 0)
gmt math -T1.5/3/0.1 0 = >> Line.txt
# Fade (t = 3 to 3.5 intensity linearly drops to -0.75 during fading)
gmt math -T3/3.5/0.1 T 3 SUB 1.5 MUL NEG = >> Line.txt
# Code (t = 3.5 5 intensity stays at -0.75 during coda)
gmt math -T3.5/5/0.1 -0.75 = >> Line.txt
gmt basemap -R-1/5/-1/6.5 -BWStr -BxcCustom_annoLine.txt -Bya+l"Color intensity" -c
gmt plot -W3p,green <<- EOF
-1 0
5 0
EOF
gmt plot -W0.25p,- <<- EOF
-1 0
6 0
EOF
gmt plot -W2p Line.txt
gmt plot -Sv12p+bt+et+s -W1.5p,red <<- EOF
-0.5 5.5 1.5 5.5
EOF
gmt plot -Sv12p+bt+et+s -W1.5p,blue <<- EOF
0 6 3 6
EOF
gmt plot -St12p -Gblue <<- EOF
0 -0.9
3 -0.9
EOF
gmt text -F+f9p -Gwhite <<- EOF
-0.25 -0.4 RISE
0.3 -0.4 PLATEAU
1 -0.4 DECAY
2.25 -0.4 NORMAL
3.25 +0.4 FADE
4.25 -0.4 CODA
0.5 5.5 ANNOUNCE
1.5 6 DURATION OF EVENT
EOF
# COLOR ADJUSTMENT
# Rise (t = -0.5 to 0 symbol dz goes from 0 to 1)
gmt math -T-0.5/0/0.02 T 0.5 ADD 2 MUL 2 POW = Line.txt
# plateau (t = 0 to 0.5 symbol dz stays at 1)
gmt math -T0/0.6/0.1 1 = >> Line.txt
# Decay (t = 0.5 to 1.5 symbol dz decays from 1 to 0)
gmt math -T0.6/1.5/0.02 0.9 T 0.6 SUB SUB 0.9 DIV 2 POW = >> Line.txt
# active (t = 1.5 to 3 symbol dz stays at 0)
gmt math -T1.5/3/0.1 0 = >> Line.txt
# Fade (t = 3 to 3.5 symbol dz linearly drops to -0.2 during fading)
gmt math -T3/3.5/0.1 T 3 SUB 0.4 MUL NEG = >> Line.txt
# Coda (t = 3.5 5 symbol dz stays at -0.2 during code)
gmt math -T3.5/5/0.1 -0.2 = >> Line.txt
gmt basemap -R-1/5/-0.30/1.30 -BWStr -BxcCustom_annoLine.txt -Bya+l"Symbol @~D@~z" -c
gmt plot -W3p,green <<- EOF
-1 0
5 0
EOF
gmt plot -W0.25p,- <<- EOF
-1 0
6 0
EOF
gmt plot -W2p Line.txt
gmt plot -Sv12p+bt+et+s -W1.5p,red <<- EOF
-0.5 1.10 1.5 1.10
EOF
gmt plot -Sv12p+bt+et+s -W1.5p,blue <<- EOF
0 1.20 3 1.20
EOF
gmt plot -St12p -Gblue <<- EOF
0 -0.18
3 -0.18
EOF
gmt text -F+f9p -Gwhite <<- EOF
-0.25 -0.07 RISE
0.3 -0.07 PLATEAU
1 -0.07 DECAY
2.25 -0.07 NORMAL
3.25 -0.07 FADE
4.25 -0.07 CODA
0.5 1.10 ANNOUNCE
1.5 1.20 DURATION OF EVENT
EOF
# TRANSPARENY
# Rise (t = -0.5 to 0 transparency goes from 100 to 0)
gmt math -T-0.5/0/0.02 1 T 0.5 ADD 2 MUL SUB 2 POW 100 MUL = Line.txt
# plateau, decay, normal (t = 0 to 3 transparency stays at 0)
gmt math -T0/3/0.1 0 = >> Line.txt
# Fade (t = 3 to 3.5 transparency linearly increases to 75 during fading)
gmt math -T3/3.5/0.1 T 3 SUB 2 MUL 75 MUL = >> Line.txt
# Code (t = 3.5 5 transparency stays at 75 during coda)
gmt math -T3.5/5/0.1 75 = >> Line.txt
gmt basemap -R-1/5/-20/130 -BWStr -BxcCustom_annoLine.txt -Bya+l"Symbol transparency" -c
gmt plot -W3p,green <<- EOF
-1 100
0 100
0 0
3 0
3 100
5 100
EOF
gmt plot -W0.25p,- <<- EOF
-1 0
6 0
EOF
gmt plot -W2p Line.txt
gmt plot -Sv12p+bt+et+s -W1.5p,red <<- EOF
-0.5 110 1.5 110
EOF
gmt plot -Sv12p+bt+et+s -W1.5p,blue <<- EOF
0 120 3 120
EOF
gmt plot -St12p -Gblue <<- EOF
0 -18
3 -18
EOF
gmt text -F+f9p -Gwhite <<- EOF
-0.25 -7 RISE
0.3 -7 PLATEAU
1 -7 DECAY
2.25 -7 NORMAL
3.25 -7 FADE
4.25 -7 CODA
0.5 110 ANNOUNCE
1.5 120 DURATION OF EVENT
EOF
# LABELS
# Rise (t = -0.5 to 0 transparency goes from 100 to 0)
gmt math -T-0.5/0/0.02 1 T 0.5 ADD 2 MUL SUB 2 POW 100 MUL = Line.txt
# normal (t = 0 to 3 transparency stays at 0)
gmt math -T0/3/0.1 0 = >> Line.txt
# Fade (t = 3 to 3.5 transparency linearly increases to 100 during fading)
gmt math -T3/3.5/0.1 T 3 SUB 2 MUL 100 MUL = >> Line.txt
# Code (t = 3.5 5 transparency stays at 100 during coda)
gmt math -T3.5/5/0.1 100 = >> Line.txt
gmt basemap -R-1/5/-20/130 -BWStr -BxcCustom_annoLine.txt -Bya+l"Label transparency" -c
gmt plot -W3p,green <<- EOF
-1 100
0 100
0 0
3 0
3 100
5 100
EOF
gmt plot -W0.25p,- <<- EOF
-1 0
6 0
EOF
gmt plot -W2p Line.txt
gmt plot -Sv12p+bt+et+s -W1.5p,blue <<- EOF
0 110 3 110
EOF
gmt plot -St12p -Gblue <<- EOF
0 -18
3 -18
EOF
gmt text -F+f9p -Gwhite <<- EOF
-0.25 -7 RISE
1.5 -7 NORMAL
3.25 -7 FADE
4.25 -7 CODA
1.5 120 FULL VISIBILITY OF LABEL
EOF
gmt subplot end
rm -f Custom_annoLine.txt Line.txt
gmt end show