Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

GMT_App_F_stand+_iso+.sh 3.1 KB

You have to be logged in to leave a comment. Sign In
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
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
  1. #!/usr/bin/env bash
  2. #
  3. # Makes the octal code charts in Appendix F for ISO and Standard
  4. #
  5. # To show both ISOLatin1+ and Standard+ on the same figure we must
  6. # make them separately then rasterize them and then plot those images
  7. # since we cannot have two different character sets active in one PS.
  8. rm -f gmt.conf # We cannot have that set yet, will do later.
  9. # First col is row number, the remaining cols are col number in table
  10. # that has a printable character
  11. cat << EOF > tt.txt
  12. 3 1 2 3 4 5 6 7
  13. 4 0 1 2 3 4 5 6 7
  14. 5 0 1 2 3 4 5 6 7
  15. 6 0 1 2 3 4 5 6 7
  16. 7 0 1 2 3 4 5 6 7
  17. 8 0 1 2 3 4 5 6 7
  18. 9 0 1 2 3 4 5 6 7
  19. 10 0 1 2 3 4 5 6 7
  20. 11 0 1 2 3 4 5 6 7
  21. 12 0 1 2 3 4 5 6 7
  22. 13 0 1 2 3 4 5 6 7
  23. 14 0 1 2 3 4 5 6 7
  24. 15 0 1 2 3 4 5 6 7
  25. 16 0 1 2 3 4 5 6 7
  26. 17 0 1 2 3 4 5 6 7
  27. 18 0 1 2 3 4 5 6 7
  28. 19 0 1 2 3 4 5 6 7
  29. 20 1 2 3 4 5 6 7
  30. 21 0 1 2 3 4 5 6 7
  31. 22 0 1 2 3 4 5 6 7
  32. 23 0 1 2 3 4 5 6 7
  33. 24 0 1 2 3 4 5 6 7
  34. 25 0 1 2 3 4 5 6 7
  35. 26 0 1 2 3 4 5 6 7
  36. 27 0 1 2 3 4 5 6 7
  37. 28 0 1 2 3 4 5 6 7
  38. 29 0 1 2 3 4 5 6 7
  39. 30 0 1 2 3 4 5 6 7
  40. 31 0 1 2 3 4 5 6 7
  41. EOF
  42. # Use the row, col values to generate the octal code needed and
  43. # plot it with gmt pstext, including the header row and left column
  44. cat << EOF > tt.awk
  45. BEGIN {
  46. printf "0.5 2.5 10p,4 octal\n"
  47. for (i = 0; i < 8; i++)
  48. {
  49. printf "%g 2.5 10p,4 %d\n", i + 1.5, i
  50. }
  51. }
  52. {
  53. printf "0.5 %g 10p,4 \\\\\\\%02ox\n", \$1+0.5, \$1
  54. for (i = 2; i <= NF; i++)
  55. {
  56. printf "%g %g 10p,4 \\\\%02o%o\n", \$i+1.5, \$1+0.5, \$1, \$i
  57. }
  58. }
  59. EOF
  60. $AWK -f tt.awk tt.txt > tt.d
  61. gmt begin
  62. gmt set MAP_FRAME_PEN thick FONT_TITLE 14p
  63. # First chart for standard font
  64. gmt figure stand+ png A,E600
  65. # Chart for Standard+ font
  66. gmt set PS_CHAR_ENCODING Standard+
  67. # First mark uncoded entries
  68. gmt plot -R0/9/2/32 -Jx0.345i/-0.21i -BN+tStandard+ -Glightred -Y0.0 << EOF
  69. >
  70. 1 4
  71. 2 4
  72. 2 3
  73. 1 3
  74. >
  75. 1 21
  76. 2 21
  77. 2 20
  78. 1 20
  79. EOF
  80. #Then highlight Standard+ enhancements
  81. gmt plot -Glightgreen << EOF
  82. >
  83. 2 4
  84. 9 4
  85. 9 3
  86. 2 3
  87. >
  88. 8 16
  89. 9 16
  90. 9 15
  91. 8 15
  92. >
  93. 1 20
  94. 9 20
  95. 9 16
  96. 1 16
  97. >
  98. 1 23
  99. 2 23
  100. 2 22
  101. 1 22
  102. >
  103. 6 23
  104. 7 23
  105. 7 22
  106. 6 22
  107. >
  108. 7 24
  109. 8 24
  110. 8 23
  111. 7 23
  112. >
  113. 1 25
  114. 2 25
  115. 2 24
  116. 1 24
  117. >
  118. 2 26
  119. 3 26
  120. 3 25
  121. 2 25
  122. >
  123. 5 26
  124. 6 26
  125. 6 25
  126. 5 25
  127. >
  128. 2 27
  129. 9 27
  130. 9 26
  131. 2 26
  132. >
  133. 1 28
  134. 9 28
  135. 9 27
  136. 1 27
  137. >
  138. 1 29
  139. 2 29
  140. 2 28
  141. 1 28
  142. >
  143. 3 29
  144. 4 29
  145. 4 28
  146. 3 28
  147. >
  148. 5 29
  149. 9 29
  150. 9 28
  151. 5 28
  152. >
  153. 1 30
  154. 2 30
  155. 2 29
  156. 1 29
  157. >
  158. 5 30
  159. 9 30
  160. 9 29
  161. 5 29
  162. >
  163. 1 31
  164. 2 31
  165. 2 30
  166. 1 30
  167. >
  168. 3 31
  169. 6 31
  170. 6 30
  171. 3 30
  172. >
  173. 7 31
  174. 9 31
  175. 9 30
  176. 7 30
  177. >
  178. 1 32
  179. 2 32
  180. 2 31
  181. 1 31
  182. >
  183. 5 32
  184. 9 32
  185. 9 31
  186. 5 31
  187. EOF
  188. gmt text tt.d -F+f
  189. gmt plot -Bg1 -Wthick << EOF
  190. >
  191. 0 3
  192. 9 3
  193. >
  194. 1 2
  195. 1 32
  196. EOF
  197. gmt figure iso+ png A,E600
  198. # Chart ISOLatin1+ font
  199. gmt set PS_CHAR_ENCODING ISOLatin1+
  200. # First the uncoded ones
  201. gmt plot -R0/9/2/32 -Jx0.345i/-0.21i -BN+tISOLatin1+ -Glightred -Y0.0 << EOF
  202. >
  203. 1 4
  204. 2 4
  205. 2 3
  206. 1 3
  207. >
  208. 1 21
  209. 2 21
  210. 2 20
  211. 1 20
  212. EOF
  213. # Then highlight ISOLatin1+ enhancements
  214. gmt plot -Glightgreen << EOF
  215. >
  216. 2 4
  217. 9 4
  218. 9 3
  219. 2 3
  220. >
  221. 8 16
  222. 9 16
  223. 9 15
  224. 8 15
  225. >
  226. 1 18
  227. 9 18
  228. 9 16
  229. 1 16
  230. >
  231. 2 20
  232. 3 20
  233. 3 19
  234. 2 19
  235. >
  236. 5 20
  237. 6 20
  238. 6 19
  239. 5 19
  240. EOF
  241. gmt text tt.d -F+f
  242. gmt plot -Bg1 -Wthick << EOF
  243. >
  244. 0 3
  245. 9 3
  246. >
  247. 1 2
  248. 1 32
  249. EOF
  250. gmt end
  251. # Must do this here instead so that the figures above are cropped
  252. gmt set -Du PS_CHAR_ENCODING ISOLatin1+ GMT_GRAPHICS_FORMAT ps
  253. gmt begin GMT_App_F_stand+_iso+
  254. gmt image stand+.png -Dx0/0+r600
  255. gmt image iso+.png -Dx0/0+r600 -X3.2i
  256. gmt end show
  257. rm stand+.png iso+.png tt.awk tt.d tt.txt
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...