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

options.rst 71 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
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
  1. Standardized command line options
  2. =================================
  3. Most of the programs take many of the same arguments such as those related
  4. to setting the data region, the map projection, etc. The switches in
  5. Table :ref:`switches <tbl-switches>` have the same meaning in all the programs (although
  6. some programs may not use all of them). These options will be described
  7. here as well as in the manual pages, as is vital that you understand how
  8. to use these options. We will present these options in order of
  9. importance (some are used a lot more than others).
  10. .. _tbl-switches:
  11. +----------+--------------------------------------------------------------------+
  12. +==========+====================================================================+
  13. | **-B** | Define tick marks, annotations, and labels for basemaps and axes |
  14. +----------+--------------------------------------------------------------------+
  15. | **-J** | Select a map projection or coordinate transformation |
  16. +----------+--------------------------------------------------------------------+
  17. | **-R** | Define the extent of the map/plot region |
  18. +----------+--------------------------------------------------------------------+
  19. | **-U** | Plot a time-stamp, by default in the lower left corner of page |
  20. +----------+--------------------------------------------------------------------+
  21. | **-V** | Select verbose operation; reporting on progress |
  22. +----------+--------------------------------------------------------------------+
  23. | **-X** | Set the *x*-coordinate for the plot origin on the page |
  24. +----------+--------------------------------------------------------------------+
  25. | **-Y** | Set the *y*-coordinate for the plot origin on the page |
  26. +----------+--------------------------------------------------------------------+
  27. | **-a** | Associate aspatial data from OGR/GMT files with data columns |
  28. +----------+--------------------------------------------------------------------+
  29. | **-b** | Select binary input and/or output |
  30. +----------+--------------------------------------------------------------------+
  31. | **-c** | Advance plot focus to selected (or next) subplot panel |
  32. +----------+--------------------------------------------------------------------+
  33. | **-d** | Replace user *nodata* values with IEEE NaNs |
  34. +----------+--------------------------------------------------------------------+
  35. | **-e** | Only process data records that match a *pattern* |
  36. +----------+--------------------------------------------------------------------+
  37. | **-f** | Specify the data format on a per column basis |
  38. +----------+--------------------------------------------------------------------+
  39. | **-g** | Identify data gaps based on supplied criteria |
  40. +----------+--------------------------------------------------------------------+
  41. | **-h** | Specify that input/output tables have header record(s) |
  42. +----------+--------------------------------------------------------------------+
  43. | **-i** | Specify which input columns to read |
  44. +----------+--------------------------------------------------------------------+
  45. | **-j** | Specify how spherical distances should be computed |
  46. +----------+--------------------------------------------------------------------+
  47. | **-l** | Add a legend entry for the symbol or line being plotted |
  48. +----------+--------------------------------------------------------------------+
  49. | **-n** | Specify grid interpolation settings |
  50. +----------+--------------------------------------------------------------------+
  51. | **-o** | Specify which output columns to write |
  52. +----------+--------------------------------------------------------------------+
  53. | **-p** | Control perspective views for plots |
  54. +----------+--------------------------------------------------------------------+
  55. | **-q** | Specify which input rows to read or output rows to write |
  56. +----------+--------------------------------------------------------------------+
  57. | **-r** | Set grid registration [Default is gridline] |
  58. +----------+--------------------------------------------------------------------+
  59. | **-s** | Control output of records containing one or more NaNs |
  60. +----------+--------------------------------------------------------------------+
  61. | **-t** | Change layer transparency |
  62. +----------+--------------------------------------------------------------------+
  63. | **-x** | Set number of cores to be used in multi-threaded applications |
  64. +----------+--------------------------------------------------------------------+
  65. | **-:** | Assume input geographic data are (*lat,lon*) and not (*lon,lat*) |
  66. +----------+--------------------------------------------------------------------+
  67. .. _option_-R:
  68. Data domain or map region: The **-R** option
  69. --------------------------------------------
  70. The **-R** option defines the map region or data domain of interest. It
  71. may be specified in one of five ways, two of which are shown in Figure
  72. :ref:`Map region <gmt_region>`:
  73. #. **-R**\ *xmin*/*xmax*/*ymin*/*ymax*. This is the standard way to
  74. specify Cartesian data domains and geographical regions when using
  75. map projections where meridians and parallels are rectilinear.
  76. #. **-R**\ *xlleft*/*ylleft*/*xuright*/*yuright*\ **+r**. This form is
  77. used with map projections that are oblique, making meridians and
  78. parallels poor choices for map boundaries. Here, we instead specify
  79. the lower left corner and upper right corner geographic coordinates,
  80. followed by the modifier **+r**. This form guarantees a rectangular map
  81. even though lines of equal longitude and latitude are not straight lines.
  82. #. **-R**\ *gridfile*. This will copy the domain settings found for the
  83. grid in specified file. Note that depending on the nature of the
  84. calling program, this mechanism will also set grid spacing and
  85. possibly the grid registration (see
  86. Section `Grid registration: The -r option`_).
  87. #. **-R**\ *code1,code2,...*\ [**+r**\|\ **R**\ [*incs*]]. This indirectly supplies
  88. the region by consulting the DCW (Digital Chart of the World) database and derives
  89. the bounding regions for one or more countries given by the codes.
  90. Simply append one or more comma-separated countries using the two-character
  91. ISO 3166-1 alpha-2 convention (e.g., https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).
  92. To select a state within a country (if available), append .state, e.g, US.TX for Texas.
  93. To specify a whole continent, prepend = to any of the continent codes AF (Africa),
  94. AN (Antarctica), AS (Asia), EU (Europe), OC (Oceania), NA (North America), or SA
  95. (South America). Append **+r** to modify exact bounding box coordinates obtained from
  96. the polygon(s): Append *inc*, *xinc*/*yinc*, or *winc*/*einc*/*sinc*/*ninc* to adjust the
  97. final region boundaries to be multiples of these steps [default is no adjustment].
  98. Alternatively, use **+R** to extend the region outward by adding these increments
  99. instead [default is no extension]. As an example, **-R**\ *FR*\ **+r**\ 1 will select
  100. the national bounding box of France rounded to nearest integer degree.
  101. #. **-R**\ *code*\ *x0*/*y0*/*nx*/*ny*. This method can be used when creating
  102. grids. Here, *code* is a 2-character combination of **L**\ , **C**\ , **R** (for left, center,
  103. or right) and **T**\ , **M**\ , **B** for top, middle, or bottom. e.g., **BL** for lower left. This
  104. indicates which point on a rectangular grid region the *x0*/*y0* coordinates
  105. refer to, and the grid dimensions *nx* and *ny* are used with grid spacings given
  106. via **-I** to create the corresponding region.
  107. .. _gmt_region:
  108. .. figure:: /_images/GMT_-R.*
  109. :width: 500 px
  110. :align: center
  111. The plot region can be specified in two different ways. (a) Extreme values
  112. for each dimension, or (b) coordinates of lower left and upper right corners.
  113. For rectilinear projections the first two forms give identical results.
  114. Depending on the selected map projection (or the kind of expected input
  115. data), the boundary coordinates may take on several different formats:
  116. Geographic coordinates:
  117. These are longitudes and latitudes and may be given in decimal
  118. degrees (e.g., -123.45417) or in the
  119. [±]\ *ddd*\ [:*mm*\ [:*ss*\ [*.xxx*]]][**W**\|\ **E**\|\ **S**\|\ **N**]
  120. format (e.g., 123:27:15W). Note that **-Rg** and **-Rd** are
  121. shorthands for "global domain" **-R**\ *0*/*360*/*-90*/*90* and
  122. **-R**\ *-180*/*180*/*-90*/*90*, respectively.
  123. When used in conjunction with the Cartesian Linear Transformation
  124. (**-Jx** or **-JX**) —which can be used to map floating point data,
  125. geographical coordinates, as well as time coordinates— it is prudent
  126. to indicate that you are using geographical coordinates in one of
  127. the following ways:
  128. - Use **-Rg** or **-Rd** to indicate the global domain.
  129. - Use **-Rg**\ *xmin*/*xmax*/*ymin*/*ymax* to indicate a limited
  130. geographic domain.
  131. - Add **W**, **E**, **S**, or **N** to the coordinate limits or add
  132. the generic **D** or **G**. Example:
  133. **-R**\ *0*/*360G*/*-90*/*90N*.
  134. Alternatively, you may indicate geographical coordinates by
  135. supplying **-fg**; see Section `Data type selection: The -f option`_.
  136. Projected coordinates:
  137. These are Cartesian projected coordinates compatible with the chosen
  138. projection and are given in a length *unit* set via the **+u** modifier, (e.g.,
  139. -200/200/-300/300\ **+uk** for a 400 by 600 km rectangular area centered
  140. on the projection center (0, 0). These coordinates are internally
  141. converted to the corresponding geographic (longitude, latitude)
  142. coordinates for the lower left and upper right corners. This form is
  143. convenient when you want to specify a region directly in the
  144. projected units (e.g., UTM meters). For allowable units, see
  145. Table :ref:`distunits <tbl-distunits>`.
  146. Calendar time coordinates:
  147. These are absolute time coordinates referring to a Gregorian or ISO
  148. calendar. The general format is [*date*]\ **T**\ [*clock*],
  149. where *date* must be in the *yyyy*\ [*-mm*\ [*-dd*]] (year, month,
  150. day-of-month) or *yyyy*\ [*-jjj*] (year and day-of-year) for
  151. Gregorian calendars and *yyyy*\ [*-*\ **W**\ *ww*\ [*-d*]] (year,
  152. week, and day-of-week) for the ISO calendar. **Note**: This format requirement
  153. only applies to command-line arguments and not time coordinates given via
  154. data files. If no *date* is given
  155. we assume the current day. The **T** flag is required if a *clock* is given.
  156. The optional *clock* string is a 24-hour clock in
  157. *hh*\ [*:mm*\ [*:ss*\ [*.xxx*]]] format. If no *clock* is given it
  158. implies 00:00:00, i.e., the start of the specified day. Note that
  159. not all of the specified entities need be present in the data. All
  160. calendar date-clock strings are internally represented as double
  161. precision seconds since proleptic Gregorian date Monday January 1
  162. 00:00:00 0001. Proleptic means we assume that the modern calendar
  163. can be extrapolated forward and backward; a year zero is used, and
  164. Gregory's reforms [11]_ are extrapolated backward. Note that this is
  165. not historical.
  166. Relative time coordinates:
  167. These are coordinates which count seconds, hours, days or years
  168. relative to a given epoch. A combination of the parameters
  169. :term:`TIME_EPOCH` and :term:`TIME_UNIT` define the epoch and time unit.
  170. The parameter :term:`TIME_SYSTEM` provides a few shorthands for common
  171. combinations of epoch and unit, like **j2000** for days since noon
  172. of 1 Jan 2000. The default relative time coordinate is that of UNIX
  173. computers: seconds since 1 Jan 1970. Denote relative time
  174. coordinates by appending the optional lower case **t** after the
  175. value. When it is otherwise apparent that the coordinate is relative
  176. time (for example by using the **-f** switch), the **t** can be omitted.
  177. Radians:
  178. For angular regions (and increments) specified in radians you may use a set of
  179. forms indicating multiples or fractions of :math:`\pi`. Valid forms are
  180. [±][*s*]pi[*f*], where *s* and *f* are any integer or floating point numbers,
  181. e.g., -2pi/2pi3 goes from -360 to 120 degrees (but in radians). When GMT parses one
  182. of these forms we alert the labeling machinery to look for certain combinations of pi,
  183. limited to *n*\ pi, 1.5pi, and fractions 3/4, 2/3, 1/2, 1/3, and 1/4 pi. When an
  184. annotated value is within roundoff-error of these combinations we typeset the label
  185. using the Greek letter for pi and required multiples or fractions.
  186. Other coordinates:
  187. These are simply any coordinates that are not related to geographic
  188. or calendar time or relative time and are expected to be simple
  189. floating point values such as
  190. [±]\ *xxx.xxx*\ [**E**\|\ **e**\|\ **D**\|\ **d**\ [±]\ *xx*],
  191. i.e., regular or exponential notations, with the enhancement to understand
  192. FORTRAN double precision output which may use **D** instead of **E** for
  193. exponents. These values are simply converted as they are to internal
  194. representation. [12]_
  195. .. _option_-J:
  196. Coordinate transformations and map projections: The **-J** option
  197. -----------------------------------------------------------------
  198. This option selects the coordinate transformation or map projection. The
  199. general format is
  200. - **-J**\ :math:`\delta`\ [*parameters*/]\ *scale*. Here, :math:`\delta`
  201. is a *lower-case* letter of the alphabet that selects a particular
  202. map projection, the *parameters* is zero or more slash-delimited
  203. projection parameter, and *scale* is map scale given in distance
  204. units per degree or as 1:xxxxx.
  205. - **-J**\ :math:`\Delta`\ [*parameters*/]\ *width*. Here, :math:`\Delta`
  206. is an *upper-case* letter of the alphabet that selects a particular
  207. map projection, the *parameters* is zero or more slash-delimited
  208. projection parameter, and *width* is map width (map height is
  209. automatically computed from the implied map scale and region).
  210. Since GMT version 4.3.0, there is an alternative way to specify the
  211. projections: use the same abbreviation as in the mapping package
  212. `PROJ <https://proj.org/>`_. The options thus either look like:
  213. - **-J**\ *abbrev*/[*parameters*/]\ *scale*. Here, *abbrev* is a
  214. *lower-case* abbreviation that selects a particular map projection,
  215. the *parameters* is zero or more slash-delimited projection
  216. parameter, and *scale* is map scale given in distance units per
  217. degree or as 1:xxxxx.
  218. - **-J**\ *Abbrev*/[*parameters*/]\ *width*. Here, *Abbrev* is an
  219. *capitalized* abbreviation that selects a particular map projection,
  220. the *parameters* is zero or more slash-delimited projection
  221. parameter, and *width* is map width (map height is automatically
  222. computed from the implied map scale and region).
  223. The projections available in GMT are presented in Figure
  224. :ref:`gmt_projections`. For details on all GMT projections and the required
  225. parameters, see the :doc:`/basemap` man page. We will also show examples of
  226. every projection in the next Chapters, and a quick summary of projection
  227. syntax is listed in :doc:`/proj-codes`.
  228. .. _gmt_projections:
  229. .. figure:: /_images/GMT_-J.*
  230. :width: 500 px
  231. :align: center
  232. The over-30 map projections and coordinate transformations available in GMT
  233. .. _option_-B:
  234. Map frame and axes annotations: The **-B** option
  235. -------------------------------------------------
  236. This is potentially the most complicated option in GMT,
  237. but most examples of its usage are actually quite simple. We distinguish
  238. between to sets of information: Frame settings and Axes parameters. These
  239. are set separately by their own **-B** invocations; hence multiple **-B**
  240. specifications may be specified. The frame settings covers things such
  241. as which axes should be plotted, canvas fill, plot title, and what type
  242. of gridlines be drawn, whereas the Axes settings deal with annotation,
  243. tick, and gridline intervals, axes labels, and annotation units.
  244. The Frame settings are specified by
  245. - **-B**\ [*axes*][**+b**][**+g**\ *fill*][**+i**\ [*val*]][**+n**][**+o**\ *lon/lat*][**+t**\ *title*]
  246. Here, the optional *axes* dictates which of the axes should be drawn
  247. and possibly annotated. By default, all 4 map boundaries (or plot axes)
  248. are plotted (denoted **W**, **E**, **S**, **N**). To change this selection,
  249. append the codes for those you want (e.g., **WSn**). In this example,
  250. the lower case **n** denotes to draw the axis and (major and minor) tick
  251. marks on the "northern" (top) edge of the plot. The upper case **WS** will
  252. annotate the "western" and "southern" axes with numerals and plot the
  253. any axis labels in addition to draw axis/tick-marks. For 3-D plots you can
  254. also specify **Z** or **z**. By default a single vertical axes will then be
  255. plotted at the most suitable map corner. You can override this by appending
  256. any combination of corner ids **1234**, where **1** represents the lower left
  257. corner and the order goes counter-clockwise. Append **+b** to draw the outline
  258. of the 3-D box defined by **-R**; this modifier is also needed to display
  259. gridlines in the x–z, y–z planes. You may paint the
  260. map canvas by appending the **+g**\ *fill* modifier [Default is no fill].
  261. Use **+i** to annotate an internal meridian or parallel when the axis that normally
  262. would be drawn and annotated does not exist (e.g., azimuthal map with 360-degree range
  263. has no latitude axis, and a global Hammer map has no longitude axis);
  264. optionally append the parallel or meridian [0].
  265. If gridlines are specified via the Axes parameters (discussed below) then
  266. by default these are referenced to the North pole. If, however, you wish
  267. to produce oblique gridlines about another pole you can append **+o**\ *lon/lat*
  268. to change this behavior (the modifier is ignored if no gridlines are requested).
  269. Append **+n** to have no frame and annotations at all [Default is controlled by the codes].
  270. Finally, you may optionally add **+t**\ *title* to place a title that
  271. will appear centered above the plot frame.
  272. The Axes settings are specified by
  273. - **-B**\ [**p**\|\ **s**][**x**\|\ **y**\|\ **z**]\ *intervals*\ [**+a**\ *angle*\|\ **n**\|\ **p**][**+l**\ *label*][**+p**\ *prefix*][**+u**\ *unit*]
  274. but you may also split this into two separate invocations for clarity, i.e.,
  275. - **-B**\ [**p**\|\ **s**][**x**\|\ **y**\|\ **z**][**+a**\ *angle*\|\ **n**\|\ **p**][**+l**\|\ **L**\ *label*][**+p**\ *prefix*][**+s**\|\ **S**\ *seclabel*][**+u**\ *unit*]
  276. - **-B**\ [**p**\|\ **s**][**x**\|\ **y**\|\ **z**]\ *intervals*
  277. The first optional flag following **-B** selects **p** (rimary) [Default] or
  278. **s** (econdary) axes information (mostly used for time axes annotations but
  279. is available for geographic axes as well. **Note**: primary refers to annotations
  280. closest to the axis and secondary to annotations further away. Hence, primary
  281. annotation-, tick-, and gridline-intervals must be shorter than their secondary counterparts).
  282. The [**x**\|\ **y**\|\ **z**] flags specify which axes you are providing information for.
  283. If none are given then we default to **xy**. If you wish to give different annotation intervals
  284. or labels for the various axes then you must repeat the **B** option for
  285. each axis (If a 3-D basemap is selected with **-p** and **-Jz**, use **-Bz**
  286. to give settings for the vertical axis.). To add a label to an axis,
  287. just append **+l**\ *label* (Cartesian projections only). Use **+L** to
  288. force a horizontal label for *y*-axes (useful for very short labels).
  289. For Cartesian axes you may specify an alternate via **+s** which is used for
  290. right or upper axis axis label (with any **+l** label used for left and bottom axes).
  291. If the axis annotation should have a leading text prefix (e.g., dollar sign for those
  292. plots of your net worth) you can append **+p**\ *prefix*. For geographic maps
  293. the addition of degree symbols, etc. is automatic (and controlled by the GMT
  294. default setting :term:`FORMAT_GEO_MAP`). However, for other plots you can add
  295. specific units by adding **+u**\ *unit*. If any of these text strings contain
  296. spaces or special characters you will need to enclose them in quotes.
  297. Cartesian x-axes also allow for the optional **+a**\ *angle*, which
  298. will plot slanted annotations; *angle* is measured with respect to the horizontal
  299. and must be in the -90 <= *angle* <= 90 range only. Also, **+an** is a shorthand
  300. for normal (i.e., **+a**\ 90) and **+ap** for parallel (i.e., **+a**\ 0) annotations
  301. [Default]. For the y-axis, arbitrary angles are not allowed but **+an** and **+ap**
  302. specify annotations normal [Default] and parallel to the axis, respectively. Note that
  303. these defaults can be changed via :term:`MAP_ANNOT_ORTHO`.
  304. The *intervals* specification is a concatenated string made up of substrings of the form
  305. [**t**]\ *stride*\ [*phase*][*unit*].
  306. The **t** flag sets the axis
  307. item of interest; the available items are listed in Table :ref:`inttype <tbl-inttype>`.
  308. Normally, equidistant annotations occur at multiples of *stride*; you
  309. can phase-shift this by appending *phase*, which can be a positive or
  310. negative number.
  311. .. _tbl-inttype:
  312. +------------+-------------------------------------+
  313. | **Flag** | **Description** |
  314. +============+=====================================+
  315. | **a** | Annotation and major tick spacing |
  316. +------------+-------------------------------------+
  317. | **f** | Minor tick spacing |
  318. +------------+-------------------------------------+
  319. | **g** | Grid line spacing |
  320. +------------+-------------------------------------+
  321. Note that the appearance of certain time annotations (month-, week-, and
  322. day-names) may be affected by the :term:`GMT_LANGUAGE`,
  323. :term:`FORMAT_TIME_PRIMARY_MAP`, and
  324. :term:`FORMAT_TIME_SECONDARY_MAP` settings.
  325. For automated plots the region may not always be the same and thus it
  326. can be difficult to determine the appropriate *stride* in advance. Here
  327. GMT provides the opportunity to auto-select the spacing between the
  328. major and minor ticks and the grid lines, by not specifying the *stride*
  329. value. For example, **-Bafg** will select all three spacings
  330. automatically for both axes. In case of longitude–latitude plots, this
  331. will keep the spacing the same on both axes. You can also use
  332. **-Bafg/afg** to auto-select them separately. Also note that given the
  333. myriad ways of specifying time-axis annotations, the automatic selections
  334. may have to be overridden with manual settings to active exactly what you need.
  335. In the case of automatic spacing, when the *stride* argument is omitted
  336. after **g**, the grid line spacing is chosen the same as the minor tick
  337. spacing; unless **g** is used in consort with **a**, then the grid lines
  338. are spaced the same as the annotations.
  339. The unit flag **u** can take on one of 18 codes; these are listed in
  340. Table :ref:`units <tbl-units>`. Almost all of these units are time-axis specific.
  341. However, the **m** and **s** units will be interpreted as arc minutes
  342. and arc seconds, respectively, when a map projection is in effect.
  343. .. _tbl-units:
  344. +------------+------------------+----------------------------------------------------------------------------------+
  345. | **Flag** | **Unit** | **Description** |
  346. +============+==================+==================================================================================+
  347. | **Y** | year | Plot using all 4 digits |
  348. +------------+------------------+----------------------------------------------------------------------------------+
  349. | **y** | year | Plot using last 2 digits |
  350. +------------+------------------+----------------------------------------------------------------------------------+
  351. | **O** | month | Format annotation using :term:`FORMAT_DATE_MAP` |
  352. +------------+------------------+----------------------------------------------------------------------------------+
  353. | **o** | month | Plot as 2-digit integer (1–12) |
  354. +------------+------------------+----------------------------------------------------------------------------------+
  355. | **U** | ISO week | Format annotation using :term:`FORMAT_DATE_MAP` |
  356. +------------+------------------+----------------------------------------------------------------------------------+
  357. | **u** | ISO week | Plot as 2-digit integer (1–53) |
  358. +------------+------------------+----------------------------------------------------------------------------------+
  359. | **r** | Gregorian week | 7-day stride from start of week (see :term:`TIME_WEEK_START`) |
  360. +------------+------------------+----------------------------------------------------------------------------------+
  361. | **K** | ISO weekday | Plot name of weekday in selected language |
  362. +------------+------------------+----------------------------------------------------------------------------------+
  363. | **k** | weekday | Plot number of day in the week (1–7) (see :term:`TIME_WEEK_START`) |
  364. +------------+------------------+----------------------------------------------------------------------------------+
  365. | **D** | date | Format annotation using :term:`FORMAT_DATE_MAP` |
  366. +------------+------------------+----------------------------------------------------------------------------------+
  367. | **d** | day | Plot day of month (1–31) or day of year (1–366) (see :term:`FORMAT_DATE_MAP`) |
  368. +------------+------------------+----------------------------------------------------------------------------------+
  369. | **R** | day | Same as **d**; annotations aligned with week (see :term:`TIME_WEEK_START`) |
  370. +------------+------------------+----------------------------------------------------------------------------------+
  371. | **H** | hour | Format annotation using :term:`FORMAT_CLOCK_MAP` |
  372. +------------+------------------+----------------------------------------------------------------------------------+
  373. | **h** | hour | Plot as 2-digit integer (0–24) |
  374. +------------+------------------+----------------------------------------------------------------------------------+
  375. | **M** | minute | Format annotation using :term:`FORMAT_CLOCK_MAP` |
  376. +------------+------------------+----------------------------------------------------------------------------------+
  377. | **m** | minute | Plot as 2-digit integer (0–60) |
  378. +------------+------------------+----------------------------------------------------------------------------------+
  379. | **S** | seconds | Format annotation using :term:`FORMAT_CLOCK_MAP` |
  380. +------------+------------------+----------------------------------------------------------------------------------+
  381. | **s** | seconds | Plot as 2-digit integer (0–60) |
  382. +------------+------------------+----------------------------------------------------------------------------------+
  383. As mentioned, there may be two levels of annotations. Here, "primary" refers to the
  384. annotation that is closest to the axis (this is the primary annotation),
  385. while "secondary" refers to the secondary annotation that is plotted
  386. further from the axis. The examples below will clarify what is meant.
  387. Note that the terms "primary" and "secondary" do not reflect any
  388. hierarchical order of units: The "primary" annotation interval is
  389. usually smaller (e.g., days) while the "secondary" annotation interval
  390. typically is larger (e.g., months).
  391. Geographic basemaps
  392. ^^^^^^^^^^^^^^^^^^^
  393. Geographic basemaps may differ from regular plot axis in that some
  394. projections support a "fancy" form of axis and is selected by the
  395. :term:`MAP_FRAME_TYPE` setting. The annotations will be formatted
  396. according to the :term:`FORMAT_GEO_MAP` template and
  397. :term:`MAP_DEGREE_SYMBOL` setting. A simple example of part of a basemap
  398. is shown in Figure :ref:`Geographic map border <basemap_border>`.
  399. .. _basemap_border:
  400. .. figure:: /_images/GMT_-B_geo_1.*
  401. :width: 500 px
  402. :align: center
  403. Geographic map border using separate selections for annotation,
  404. frame, and grid intervals. Formatting of the annotation is controlled by
  405. the parameter :term:`FORMAT_GEO_MAP` in your :doc:`/gmt.conf`.
  406. The machinery for primary and secondary annotations introduced for
  407. time-series axes can also be utilized for geographic basemaps. This may
  408. be used to separate degree annotations from minutes- and
  409. seconds-annotations. For a more complicated basemap example using
  410. several sets of intervals, including different intervals and pen
  411. attributes for grid lines and grid crosses, see Figure :ref:`Complex basemap
  412. <complex_basemap>`.
  413. .. _complex_basemap:
  414. .. figure:: /_images/GMT_-B_geo_2.*
  415. :width: 500 px
  416. :align: center
  417. Geographic map border with both primary (P) and secondary (S) components.
  418. Cartesian linear axes
  419. ^^^^^^^^^^^^^^^^^^^^^
  420. For non-geographic axes, the :term:`MAP_FRAME_TYPE` setting is implicitly
  421. set to plain. Other than that, cartesian linear axes are very similar to
  422. geographic axes. The annotation format may be controlled with the
  423. :term:`FORMAT_FLOAT_OUT` parameter. By default, it is set to "%g", which
  424. is a C language format statement for floating point numbers [13]_, and
  425. with this setting the various axis routines will automatically determine
  426. how many decimal points should be used by inspecting the *stride*
  427. settings. If :term:`FORMAT_FLOAT_OUT` is set to another format it will be
  428. used directly (e.g., "%.2f" for a fixed, two decimals format). Note that
  429. for these axes you may use the *unit* setting to add a unit string to
  430. each annotation (see Figure :ref:`Axis label <axis_label_basemap>`).
  431. .. _axis_label_basemap:
  432. .. figure:: /_images/GMT_-B_linear.*
  433. :width: 500 px
  434. :align: center
  435. Linear Cartesian projection axis. Long tick-marks accompany
  436. annotations, shorter ticks indicate frame interval. The axis label is
  437. optional. For this example we used ``-R0/12/0/0.95 -JX7.5c/0.75c -Ba4f2g1+lFrequency+u" %" -BS``
  438. There are occasions when the length of the annotations are such that placing them
  439. horizontally (which is the default) may lead to overprinting or too few annotations.
  440. One solution is to request slanted annotations for the x-axis (e.g., Figure :ref:`Axis label <axis_slanted_basemap>`)
  441. via the **+a**\ *angle* modifier.
  442. .. _axis_slanted_basemap:
  443. .. figure:: /_images/GMT_-B_slanted.*
  444. :width: 500 px
  445. :align: center
  446. Linear Cartesian projection axis with slanted annotations.
  447. For this example we used ``-R2000/2020/35/45 -JX12c -Bxa2f+a-30 -BS``.
  448. For the y-axis only the modifier **+ap** for parallel is allowed.
  449. Cartesian log\ :sub:`10` axes
  450. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  451. Due to the logarithmic nature of annotation spacings, the *stride*
  452. parameter takes on specific meanings. The following concerns are
  453. specific to log axes (see Figure :ref:`Logarithmic projection axis
  454. <Log_projection>`):
  455. * *stride* must be 1, 2, 3, or a negative integer -n.
  456. Annotations/ticks will then occur at 1, 1-2-5, or 1,2,3,4,...,9,
  457. respectively, for each magnitude range. For *-n* the
  458. annotations will take place every *n*\ 'th magnitude.
  459. * Append **l** to *stride*. Then, log\ :sub:`10` of the annotation
  460. is plotted at every integer log\ :sub:`10` value (e.g.,
  461. *x = 100* will be annotated as "2") [Default annotates *x* as is].
  462. * Append **p** to *stride*. Then, annotations appear as 10 raised to
  463. log\ :sub:`10` of the value (e.g., 10\ :sup:`-5`).
  464. .. _Log_projection:
  465. .. figure:: /_images/GMT_-B_log.*
  466. :width: 500 px
  467. :align: center
  468. Logarithmic projection axis using separate values for annotation,
  469. frame, and grid intervals. (top) Here, we have chosen to annotate the actual
  470. values. Interval = 1 means every whole power of 10, 2 means 1, 2, 5 times
  471. powers of 10, and 3 means every 0.1 times powers of 10. We used
  472. -R1/1000/0/1 -JX7.5cl/0.6c -Ba1f2g3. (middle) Here, we have chosen to
  473. annotate :math:`\log_{10}` of the actual values, with -Ba1f2g3l.
  474. (bottom) We annotate every power of 10 using :math:`\log_{10}` of the actual
  475. values as exponents, with -Ba1f2g3p.
  476. Cartesian exponential axes
  477. ^^^^^^^^^^^^^^^^^^^^^^^^^^
  478. Normally, *stride* will be used to create equidistant (in the user's
  479. unit) annotations or ticks, but because of the exponential nature of the
  480. axis, such annotations may converge on each other at one end of the
  481. axis. To avoid this problem, you can append **p** to *stride*, and the
  482. annotation interval is expected to be in transformed units, yet the
  483. annotation itself will be plotted as un-transformed units (see Figure
  484. :ref:`Power projection axis <Pow_projection>`). E.g., if
  485. *stride* = 1 and power = 0.5 (i.e., sqrt), then equidistant annotations
  486. labeled 1, 4, 9, ... will appear.
  487. .. _Pow_projection:
  488. .. figure:: /_images/GMT_-B_pow.*
  489. :width: 500 px
  490. :align: center
  491. Exponential or power projection axis. (top) Using an exponent of 0.5
  492. yields a :math:`sqrt(x)` axis. Here, intervals refer to actual data values,
  493. in -R0/100/0/0.9 -JX3ip0.5/0.25i -Ba20f10g5.
  494. (bottom) Here, intervals refer to projected values, although the annotation
  495. uses the corresponding unprojected values, as in -Ba3f2g1p.
  496. .. _cartesian_time_axes:
  497. Cartesian time axes
  498. ^^^^^^^^^^^^^^^^^^^
  499. What sets time axis apart from the other kinds of plot axes is the
  500. numerous ways in which we may want to tick and annotate the axis. Not
  501. only do we have both primary and secondary annotation items but we also
  502. have interval annotations versus tick-mark annotations, numerous time
  503. units, and several ways in which to modify the plot. We will demonstrate
  504. this flexibility with a series of examples. While all our examples will
  505. only show a single *x*\ -axis (south, selected via **-BS**), time-axis
  506. annotations are supported for all axes.
  507. Our first example shows a time period of almost two months in Spring
  508. 2000. We want to annotate the month intervals as well as the date at the start of each week:
  509. .. literalinclude:: /_verbatim/GMT_-B_time1.txt
  510. These commands result in Figure :ref:`Cartesian time axis <cartesian_axis1>`.
  511. Note the leading hyphen in the :term:`FORMAT_DATE_MAP`
  512. removes leading zeros from calendar items (e.g., 02 becomes 2).
  513. .. _cartesian_axis1:
  514. .. figure:: /_images/GMT_-B_time1.*
  515. :width: 500 px
  516. :align: center
  517. Cartesian time axis, example 1
  518. The next example shows two different ways to annotate an axis portraying 2 days in July 1969:
  519. .. literalinclude:: /_verbatim/GMT_-B_time2.txt
  520. The lower example (Figure :ref:`cartesian_axis2`) chooses to annotate the weekdays (by
  521. specifying **a**\ 1\ **K**) while the upper example choses dates (by
  522. specifying **a**\ 1\ **D**). Note how the clock format only selects
  523. hours and minutes (no seconds) and the date format selects a month name,
  524. followed by one space and a two-digit day-of-month number.
  525. .. _cartesian_axis2:
  526. .. figure:: /_images/GMT_-B_time2.*
  527. :width: 500 px
  528. :align: center
  529. Cartesian time axis, example 2
  530. The third example (Figure :ref:`cartesian_axis3`) presents two years, annotating
  531. both the years and every 3rd month.
  532. .. literalinclude:: /_verbatim/GMT_-B_time3.txt
  533. Note that while the year annotation is centered on the 1-year interval,
  534. the month annotations must be centered on the corresponding month and
  535. *not* the 3-month interval. The :term:`FORMAT_DATE_MAP` selects month name
  536. only and :term:`FORMAT_TIME_PRIMARY_MAP` selects the 1-character, upper
  537. case abbreviation of month names using the current language (selected by
  538. :term:`GMT_LANGUAGE`).
  539. .. _cartesian_axis3:
  540. .. figure:: /_images/GMT_-B_time3.*
  541. :width: 500 px
  542. :align: center
  543. Cartesian time axis, example 3
  544. The fourth example (Figure :ref:`cartesian_axis4`) only shows a few hours of a day, using
  545. relative time by specifying **t** in the **-R** option while the
  546. :term:`TIME_UNIT` is **d** (for days). We select both primary and secondary
  547. annotations, ask for a 12-hour clock, and let time go from right to left:
  548. .. literalinclude:: /_verbatim/GMT_-B_time4.txt
  549. .. _cartesian_axis4:
  550. .. figure:: /_images/GMT_-B_time4.*
  551. :width: 500 px
  552. :align: center
  553. Cartesian time axis, example 4
  554. The fifth example shows a few weeks of time (Figure :ref:`cartesian_axis5`). The lower axis
  555. shows ISO weeks with week numbers and abbreviated names of the weekdays.
  556. The upper uses Gregorian weeks (which start at the day chosen by
  557. :term:`TIME_WEEK_START`); they do not have numbers.
  558. .. literalinclude:: /_verbatim/GMT_-B_time5.txt
  559. .. _cartesian_axis5:
  560. .. figure:: /_images/GMT_-B_time5.*
  561. :width: 500 px
  562. :align: center
  563. Cartesian time axis, example 5
  564. Our sixth example (Figure :ref:`cartesian_axis6`) shows the first five months of
  565. 1996, and we have annotated each month with an abbreviated, upper case name and
  566. 2-digit year. Only the primary axes information is specified.
  567. .. literalinclude:: /_verbatim/GMT_-B_time6.txt
  568. .. _cartesian_axis6:
  569. .. figure:: /_images/GMT_-B_time6.*
  570. :width: 500 px
  571. :align: center
  572. Cartesian time axis, example 6
  573. Our seventh and final example (Figure :ref:`cartesian_axis7`) illustrates
  574. annotation of year-days. Unless we specify the formatting with a leading hyphen
  575. in :term:`FORMAT_DATE_MAP` we get 3-digit integer days. Note that
  576. in order to have the two years annotated we need to allow for the annotation of
  577. small fractional intervals; normally such truncated interval must be at
  578. least half of a full interval.
  579. .. literalinclude:: /_verbatim/GMT_-B_time7.txt
  580. .. _cartesian_axis7:
  581. .. figure:: /_images/GMT_-B_time7.*
  582. :width: 500 px
  583. :align: center
  584. Cartesian time axis, example 7
  585. .. _custom_axes:
  586. Custom axes
  587. ^^^^^^^^^^^
  588. Irregularly spaced annotations or annotations based on
  589. look-up tables can be implemented using the *custom* annotation
  590. mechanism. Here, we given the **c** (custom) type to the **-B** option
  591. followed by a filename that contains the annotations (and
  592. tick/grid-lines specifications) for one axis. The file can contain any
  593. number of comments (lines starting with #) and any number of records of
  594. the format
  595. | *coord* *type* [*label*]
  596. The *coord* is the location of the desired annotation, tick, or
  597. grid-line, whereas *type* is a string composed of letters from **a**
  598. (annotation), **i** interval annotation, **f** frame tick, and **g**
  599. gridline. You must use either **a** or **i** within one file; no mixing
  600. is allowed. The coordinates should be arranged in increasing order. If
  601. *label* is given it replaces the normal annotation based on the *coord*
  602. value. Our last example (Figure :ref:`Custom and irregular annotations
  603. <Custom_annotations>`) shows such a custom basemap with an interval
  604. annotations on the *x*-axis and irregular annotations on the *y*-axis.
  605. .. literalinclude:: /_verbatim/GMT_-B_custom.txt
  606. .. _Custom_annotations:
  607. .. figure:: /_images/GMT_-B_custom.*
  608. :width: 500 px
  609. :align: center
  610. Custom and irregular annotations, tick-marks, and gridlines.
  611. .. _option_-U:
  612. Timestamps on plots: The **-U** option
  613. --------------------------------------
  614. The **-U** option draws the GMT system time stamp on the plot.
  615. By appending **+j**\ *just* and/or **+o**\ *dx/dy*, the user may
  616. specify the justification of the stamp and where the stamp should fall
  617. on the page relative to lower left corner of the plot.
  618. For example, +jBL+o0/0 will align the lower left corner of the time stamp
  619. with the bottom left corner of the plot [BL]. Optionally, append an
  620. arbitrary text string (surrounded by double quotes), or give **+c**,
  621. which will plot the current command string (Figure :ref:`Time stamp <fig_-U>`).
  622. .. _fig_-U:
  623. .. figure:: /_images/GMT_-U.*
  624. :width: 500 px
  625. :align: center
  626. The -U option makes it easy to date a plot.
  627. .. _option_-V:
  628. Verbose feedback: The **-V** option
  629. -----------------------------------
  630. The **-V** option controls the verbosity mode, which determines which
  631. messages are sent to standard error [Default **-Vw** reports errors and warnings].
  632. Even more verbose levels are **-Vi** (or just **-V**; for informational messages)
  633. and **-Vd** (debug). If compiled with backward-compatibility
  634. you can select **-Vc**, which includes warnings about deprecated usage. To study
  635. the run-time of time-intensive algorithms you can use **-Vt** (where available).
  636. Finally, **-Vq** can be used to run without any warnings or errors. This
  637. option can also be set by specifying the default :term:`GMT_VERBOSE`, as
  638. **quiet**, **error**, **warning**, **timing**, **compat**, **information**, or
  639. **debug**, in order of increased verbosity.
  640. .. _option_-X:
  641. .. _option_-Y:
  642. Plot positioning and layout: The **-X** **-Y** options
  643. ------------------------------------------------------
  644. The **-X** and **-Y** options shift plot origin relative to the current origin by
  645. (*xshift*,\ *yshift*); optionally append the length unit
  646. (**c**, **i**, or **p**). Default is (:term:`MAP_ORIGIN_X`,
  647. :term:`MAP_ORIGIN_Y`) for new plots [15]_. Subsequent overlays will
  648. be co-registered with the previous plot unless the origin is shifted using
  649. these options. You can prepend **a** to shift the origin
  650. back to the original position after the plot module completes, prepend **c** to
  651. center the plot on the center of the paper (optionally add a shift),
  652. prepend **f** to shift the origin relative to the fixed lower left
  653. corner of the page, or prepend **r** [Default] to move the origin
  654. relative to its current location. When **-X**
  655. or **-Y** are used without any further arguments, the values from
  656. the last use of that option in a previous GMT command will be used.
  657. Note that **-X** and **-Y** can also access the previous plot bounding box dimensions
  658. *w* and *h* and construct offsets that involves them. For instance, to move the origin
  659. up 2 cm beyond the height of the previous plot, use **-Y**\ *h*\ +2c.
  660. To move the origin half the width to the right, use **-X**\ *w*\ /2.
  661. .. _XY_options:
  662. .. figure:: /_images/GMT_-XY.*
  663. :width: 300 px
  664. :align: center
  665. Plot origin can be translated freely with -X -Y.
  666. .. _option_-a:
  667. OGR/GMT GIS i/o: The **-a** option
  668. ----------------------------------
  669. GMT relies on external tools to translate geospatial files such as
  670. shapefiles into a format we can read. The tool **ogr2ogr** in the GDAL
  671. package can do such translations and preserve the aspatial metadata via
  672. a new OGR/GMT format specification (See Chapter :doc:`ogrgmt-format`).
  673. For this to be useful we need a mechanism to associate certain metadata values with
  674. required input and output columns expected by GMT programs. The **-a**
  675. option allows you to supply one or more comma-separated associations
  676. *col=name*, where *name* is the name of an aspatial attribute field in a
  677. OGR/GMT file and whose value we wish to as data input for column *col*.
  678. The given aspatial field thus replaces any other value already set. Note
  679. that *col = 0* is the first data columns. Note that if no aspatial
  680. attributes are needed then the **-a** option is not needed – GMT will
  681. still process and read such data files.
  682. OGR/GMT input with **-a** option
  683. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  684. If you need to populate GMT data columns with (constant) values
  685. specified by aspatial attributes, use **-a** and append any number of
  686. comma-separated *col=name* associations. E.g., *2=depth* will read the
  687. spatial *x,y* columns from the file and add a third (*z*) column based
  688. on the value of the aspatial field called *depth*. You can also
  689. associate aspatial fields with other settings such as labels, fill
  690. colors, pens, and values used to look-up colors. Do so by letting the
  691. *col* value be one of **D**, **G**, **L**, **T**, **W**, or **Z**. This
  692. works analogously to how standard multi-segment files can pass such
  693. options via its segment headers (See Chapter :doc:`file-formats`).
  694. OGR/GMT output with **-a** option
  695. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  696. You can also make GMT table-writing tools output the OGR/GMT format
  697. directly. Again, specify if certain GMT data columns with constant
  698. values should be stored as aspatial metadata using the
  699. *col=name*\ [:*type*], where you can optionally specify what data type
  700. it should be (double, integer, string, logical, byte, or datetime)
  701. [double is default]. As for input, you can also use the special *col*
  702. entries of **D**, **G**, **L**, **T**, **W**, or **Z** to have values
  703. stored as options in segment headers be used as the source for the name
  704. aspatial field. Finally, for output you must append
  705. +\ **g**\ *geometry*, where *geometry* can be any of
  706. [**M**]\ **POINT**\|\ **LINE**\|\ **POLY**; the
  707. **M** represent the multi-versions of these three geometries. Use
  708. upper-case +\ **G** to signal that you want to split any line or polygon
  709. features that straddle the Dateline.
  710. .. _option_-binary:
  711. Binary table i/o: The **-b** option
  712. -----------------------------------
  713. All GMT programs that accept table data as *primary* input may read ASCII, native
  714. binary, shapefiles, or netCDF tables (Any *secondary* input files provided via command line
  715. options are always expected to be in ASCII format). Native binary files may have a header section
  716. and the **-h**\ *n* option (see Section `Header data records: The -h option`_) can be used to
  717. skip the first *n* bytes. The data record can be in any format, you may mix
  718. different data types and even byte-swap individual columns or the entire record. When using
  719. native binary data the user must be aware of the fact that GMT has no
  720. way of determining the actual number of columns in the file. You must
  721. therefore pass that information to GMT via the binary
  722. **-bi** *n*\ **t** option, where *n* is the number of data
  723. columns of given type **t**, where **t** must be one of **c** (signed 1-byte character,
  724. int8_t), **u** (unsigned 1-byte character, uint8_t), **h** (signed
  725. 2-byte int, int16_t), **H** (unsigned 2-byte int, uint16_t), **i**
  726. (signed 4-byte int, int32_t), **I** (unsigned 4-byte int, uint32_t),
  727. **l** (signed 8-byte int, int64_t), **L** (unsigned 8-byte int,
  728. uint64_t), **f** (4-byte single-precision float), and **d** (8-byte
  729. double-precision float). In addition, use **x** to skip *n* bytes
  730. anywhere in the record. For a mixed-type data record you can concatenate
  731. several [*n*]\ **t** combinations, separated by commas. You may append
  732. **w** to any of the items to force byte-swapping. Alternatively, append
  733. **+l**\|\ **b** to indicate that the entire data file should be
  734. read or written as little- or big-endian, respectively. Here, *n* is the
  735. number of each item in your binary file. Note that *n* may be larger
  736. than *m*, the number of columns that the GMT program requires to do
  737. its task. If *n* is not given then it defaults to *m* and all columns
  738. are assumed to be of the single specified type **t** [**d** (double), if
  739. not set]. If *n* < *m* an error is generated. Multiple segment
  740. files are allowed and the segment headers are assumed to be records
  741. where all the fields equal NaN.
  742. For native binary output, use the **-bo** option; see **-bi** for further details.
  743. Because of its meta data, reading netCDF tables (i.e., netCDF files
  744. containing 1-dimensional arrays) is quite a bit less complex than
  745. reading native binary files. When feeding netCDF tables to programs like
  746. :doc:`/plot`, the program will automatically
  747. recognize the format and read whatever amount of columns are needed for
  748. that program. To steer which columns are to be read, the user can append
  749. the suffix **?**\ *var1*\ **/**\ *var2*\ **/**\ *...* to the netCDF file
  750. name, where *var1*, *var2*, etc. are the names of the variables to be
  751. processed. No **-bi** option is needed in this case.
  752. Currently, netCDF tables can only be input, not output. For more
  753. information, see Chapter :doc:`file-formats`.
  754. .. _option_-c:
  755. Selecting subplot panels: The **-c** option
  756. -------------------------------------------
  757. When using :doc:`/subplot` to assemble multiple individual panels in a
  758. matrix layout, we use **-c** to either advance the focus of plotting to
  759. the next panel in the sequence (either by row or by column as set by
  760. subplot's **-A** option) or to specify directly the *row*,\ *col* or
  761. 1-D *index* of the desired panel. The **-c** option is only allowed
  762. when in subplot mode. If no **-c** option is given for the first plot
  763. then we default to *row* = *col* = *index* = 0, i.e., the upper left
  764. panel. **Note**: *row*, *col*, and *index* all start at 0.
  765. .. _option_-d:
  766. Missing data conversion: The **-d** option
  767. ------------------------------------------
  768. Within GMT, any missing values are represented by the IEEE NaN value.
  769. However, there are occasionally the need to handle user data where
  770. missing data are represented by some unlikely data value such as -99999.
  771. Since GMT cannot guess that in your data set -99999 is a special value,
  772. you can use the **-d** option to have such values replaced with NaNs.
  773. Similarly, should your GMT output need to conform to such a requirement
  774. you can replace all NaNs with the chosen nodata value. If only input
  775. or output should be affected, use **-di** or **-do**, respectably.
  776. .. _option_-e:
  777. Data record pattern matching: The **-e** option
  778. -----------------------------------------------
  779. Modules that read ASCII tables will normally process all the data records
  780. that are read. The **-e** option offers a built-in pattern scanner that
  781. will only pass records that match the given *pattern* or regular expressions.
  782. The test can also be inverted to only pass data records that *do not* match
  783. the pattern. The test is *not* applied to header or segment headers.
  784. To reverse the search, i.e., to only accept data records that do *not*
  785. contain the specified pattern, use **-e~**. Should your pattern happen
  786. to start with ~ you will need to escape this character with a backslash
  787. [Default accepts all data records]. For matching data records
  788. against extended `Regular Expressions <https://en.wikipedia.org/wiki/Regular_expression>`_,
  789. please enclose the expression in slashes. Append **i** for case-insensitive matching.
  790. To supply a list of such patterns, give **+f**\ *file* with one pattern per line.
  791. To give a single pattern starting with **+f**, escape it with a backslash.
  792. .. _option_-f:
  793. Data type selection: The **-f** option
  794. --------------------------------------
  795. When map projections are not required we must explicitly state what kind
  796. of data each input or output column contains. This is accomplished with
  797. the **-f** option. Following an optional **i** (for input only) or **o**
  798. (for output only), we append a text string with information about each
  799. column (or range of columns) separated by commas. Each string starts
  800. with the column number (0 is first column) followed by either **x**
  801. (longitude), **y** (latitude), **T** (absolute calendar time) or **t**
  802. (relative time). If several consecutive columns have the same format you
  803. may specify a range of columns rather than a single column. Column ranges
  804. must be given in the format *start*\ [:*inc*]:*stop*, where *inc* defaults
  805. to 1 if not specified). For example, if our input file has geographic
  806. coordinates (latitude, longitude) with absolute calendar coordinates in
  807. the columns 3 and 4, we would specify **fi**\ 0\ **y**,1\ **x**,3:4\ **T**.
  808. All other columns are assumed to
  809. have the default, floating point format and need not be set
  810. individually. The shorthand **-f**\ [**i**\|\ **o**]\ **g**
  811. means **-f**\ [**i**\|\ **o**]0x,1y (i.e., geographic
  812. coordinates). A special use of **-f** is to select **-fp**\ [*unit*],
  813. which *requires* **-J** and lets you use *projected* map coordinates
  814. (e.g., UTM meters) as data input. Such coordinates are automatically
  815. inverted to longitude, latitude during the data import. Optionally,
  816. append a length *unit* (see Table :ref:`distunits <tbl-distunits>`) [meter]. For more
  817. information, see Sections :ref:`input-data-formats` and :ref:`output-data-formats`.
  818. .. _option_-g:
  819. Data gap detection: The **-g** option
  820. -------------------------------------
  821. GMT has several mechanisms that can determine line
  822. segmentation. Typically, data segments are separated by multiple segment
  823. header records (see Chapter :doc:`file-formats`). However, if key data columns contain a
  824. NaN we may also use that information to break lines into multiple
  825. segments. This behavior is modified by the parameter
  826. :term:`IO_NAN_RECORDS` which by default is set to *skip*, meaning such
  827. records are considered bad and simply skipped. If you wish such records
  828. to indicate a segment boundary then set this parameter to *pass*.
  829. Finally, you may wish to indicate gaps based on the data values
  830. themselves. The **-g** option is used to detect gaps based on one or
  831. more criteria (use **-ga** if *all* the criteria must be met; otherwise
  832. only one of the specified criteria needs to be met to signify a data
  833. gap). Gaps can be based on excessive jumps in the *x*- or
  834. *y*-coordinates (**-gx** or **-gy**), or on the distance between points
  835. (**-gd**). Append the *gap* distance and optionally a unit for actual
  836. distances. For geographic data the optional unit may be arc
  837. **d**\ egree, **m**\ inute, and **s**\ econd, or m\ **e**\ ter
  838. [Default], **f**\ eet, **k**\ ilometer, **M**\ iles, or **n**\ autical
  839. miles. For programs that map data to map coordinates you can optionally
  840. specify these criteria to apply to the projected coordinates (by using
  841. upper-case **-gX**, **-gY** or **-gD**). In that case, choose from
  842. **c**\ entimeter, **i**\ nch or **p**\ oint [Default unit is controlled
  843. by :term:`PROJ_LENGTH_UNIT`]. **Note**: For **-gx** or **-gy** with time data
  844. the unit is instead controlled by :term:`TIME_UNIT`.
  845. Normally, a gap is computed as the absolute value of the
  846. specified distance measure (see above). Append **+n** to compute the gap
  847. as previous minus current column value and **+p** for current minus previous
  848. column value.
  849. .. _option_-h:
  850. Header data records: The **-h** option
  851. --------------------------------------
  852. The **-h**\ [**i**\|\ **o**][*n*][**+c**][**+d**][**+m**\ *segheader*][**+r**\ *remark*][**+t**\ *title*] option
  853. lets GMT know that input file(s) have *n_recs* header records [0]. If
  854. there are more than one header record you must specify the number after
  855. the **-h** option, e.g., **-h**\ 4. Note that blank lines and records
  856. that start with the character # are *automatically* considered header
  857. records and skipped, hence **-h** is not needed to skip such records.
  858. Thus, *n_recs* refers to general text lines that
  859. do *not* start with # and thus must specifically be skipped in order for
  860. the programs to function properly. The default number of such header
  861. records if **-h** is used is one of the many parameters in the :doc:`/gmt.conf` file
  862. (:term:`IO_N_HEADER_RECS`, by default 0), but can be overridden by
  863. **-h**\ *n_header_recs*. Normally, programs that both read and write
  864. tables will output the header records that are found on input. Use
  865. **-hi** to suppress the writing of header records. You can use the
  866. **-h** options modifiers to tell programs to output extra header
  867. records for titles (**+t**), remarks (**+r**), or column names (**+c**)
  868. identifying each data column, or delete (**+d**) the original headers.
  869. You can even add a single segment header (**+m**) after the initial header
  870. section.
  871. When **-b** is used to indicate binary data the **-h** takes on a
  872. slightly different meaning. Now, the *n_recs* argument is taken to mean
  873. how many *bytes* should be skipped (on input) or padded with the space
  874. character (on output).
  875. .. _option_-i:
  876. Input columns selection: The **-i** option
  877. ------------------------------------------
  878. The **-i**\ *columns* option allows you to specify which
  879. input file physical data columns to use and in what order. By default, GMT will
  880. read all the data columns in the file, starting with the first column
  881. (0). Using **-i** modifies that process and reads in a logical record based
  882. on columns from the physical record. For instance, to use the 4th,
  883. 7th, and 3rd data column as the required *x,y,z* to
  884. :doc:`/blockmean` you would specify
  885. **-i**\ 3,6,2 (since 0 is the first column). The chosen data columns
  886. will be used as given. Optionally, you can specify that input columns
  887. should be transformed according to a linear or logarithmic conversion.
  888. Do so by appending [**+l**][**+s**\ *scale*][**+o**\ *offset*] to
  889. each column (or range of columns). All items are optional: The **+l**
  890. implies we should first take :math:`\log_{10}` of the data [leave as
  891. is]. Next, we may scale the result by the given *scale* [1]. Finally, we
  892. add in the specified *offset* [0]. If you want the trailing text to remain
  893. part of your subset logical record then you must also select the special column
  894. by requesting column **t**, otherwise we ignore trailing text. If you only
  895. want to select one word from the trailing text, then append the word number
  896. (0 is the first word). Finally, to use the entire numerical record and
  897. ignore all trailing text, use **-in**.
  898. .. _gmt_record:
  899. .. figure:: /_images/GMT_record.png
  900. :width: 600 px
  901. :align: center
  902. The physical, logical (input) and output record in GMT. Here, we are
  903. reading a file with 5 numerical columns plus some free-form text at the
  904. end. Our module (here :doc:`/plot`) will be used to plot circles at the
  905. given locations but we want to assign color based on the ``depth`` column
  906. (which we need to convert from meters to km) and symbol size based on the
  907. ``mag`` column (but we want to scale the magnitude by 0.01 to get suitable symbol sizes).
  908. We use **-i** to pull in the desired columns in the required order and apply
  909. the scaling, resulting in a logical input record with 4 columns. The **-f** option
  910. can be used to specify column types in the logical record if it is not clear
  911. from the data themselves (such as when reading a binary file). Finally, if
  912. a module needs to write out only a portion of the current logical record then
  913. you may use the corresponding **-o** option to select desired columns, including
  914. the trailing text column **t**. If you only want to output one word from the
  915. trailing text, then append the word number (0 is the first word). Note that
  916. these column numbers now refer to the logical record, not the physical, since
  917. after reading the data there is no physical record, only the logical record in memory.
  918. .. _option_-j_distcalc:
  919. Spherical distance calculations: The **-j** option
  920. --------------------------------------------------
  921. GMT has different ways to compute distances on planetary bodies.
  922. By default (**-jg**) we perform great circle distance calculations, and parameters such
  923. as distance increments or radii will be compared against calculated great
  924. circle distances. To simplify and speed up calculations you can select Flat
  925. Earth mode (**-jf**) instead, which gives an approximate but faster result. Alternatively,
  926. you can select ellipsoidal (**-je**; i.e., geodesic) mode for the highest precision
  927. (and slowest calculation time). All spherical distance calculations depend on
  928. the current ellipsoid (:term:`PROJ_ELLIPSOID`), the definition of
  929. the mean radius (:term:`PROJ_MEAN_RADIUS`), and the specification
  930. of latitude type (:term:`PROJ_AUX_LATITUDE`). Geodesic distance
  931. calculations is also controlled by method (:term:`PROJ_GEODESIC`).
  932. .. _option_-l:
  933. Setting automatic legend entries: The **-l** option
  934. ---------------------------------------------------
  935. Map or plot legends are created by :doc:`/legend` and normally this module
  936. will read a *specfile* that outlines how the legend should look. You can
  937. make very detailed and complicated legends by mixing a variety of items,
  938. such as symbol, free text, colorbars, scales, images, and more. Yet, for
  939. the vast majority of plots displaying symbols or lines a simple legend will suffice.
  940. The **-l** option is used to automatically build the *specfile* as we plot
  941. the various layers that will make up our illustration. Apart from setting
  942. the label string that goes with the current symbol or line, you can select
  943. from a series of modifiers that mirror the effect of control codes normally
  944. added to the *specfile* by hand. For instance, a simple plot with two
  945. symbols can obtain a legend by using this option and modifiers and is shown
  946. in Figure :ref:`Auto Legend <auto_legend>`::
  947. .. literalinclude:: /_verbatim/GMT_autolegend.txt
  948. As the script shows, when no *specfile* is given to :doc:`/legend` then we
  949. look for the automatically generated on in the session directory.
  950. .. _auto_legend:
  951. .. figure:: /_images/GMT_autolegend.*
  952. :width: 500 px
  953. :align: center
  954. Each of the two :doc:`/plot` commands use **-l** to add a symbol to the
  955. auto legend; the first also sets a legend header of given size and draws a horizontal line.
  956. .. _option_-n:
  957. Grid interpolation parameters: The **-n** option
  958. ------------------------------------------------
  959. The **-n**\ *type* option controls parameters used for
  960. 2-D grids resampling. You can select the type of spline used (**-nb**
  961. for B-spline smoothing, **-nc** for bicubic [Default], **-nl** for
  962. bilinear, or **-nn** for nearest-node value). For programs that support
  963. it, antialiasing is by default on; optionally, append **+a** to switch
  964. off antialiasing. By default, boundary conditions are set according to
  965. the grid type and extent. Change boundary conditions by appending
  966. **+b**\ *BC*, where *BC* is either **g** for geographic boundary
  967. conditions or one (or both) of **n** and **p** for natural or periodic
  968. boundary conditions, respectively. Append **x** or **y** to only apply
  969. the condition in one dimension. E.g., **-nb+nxpy** would imply natural
  970. boundary conditions in the *x* direction and periodic conditions in the
  971. *y* direction. Finally, append **+t**\ *threshold* to control how close
  972. to nodes with NaN the interpolation should go. A *threshold* of 1.0
  973. requires all (4 or 16) nodes involved in the interpolation to be
  974. non-NaN. 0.5 will interpolate about half way from a non-NaN value; 0.1
  975. will go about 90% of the way, etc.
  976. .. _option_-o:
  977. Output columns selection: The **-o** option
  978. -------------------------------------------
  979. The **-o**\ *columns* option allows you to specify which
  980. columns to write on output and in what order. By default, GMT will
  981. write all the data columns produced by the program. Using **-o**
  982. modifies that process. For instance, to write just the 4th and 2nd data
  983. column to the output you would use **-o**\ 3,1 (since 0 is the first column).
  984. You can also use a column more than once, e.g., **-o**\ 3,1,3, to
  985. duplicate a column on output. Finally, if your logical record in memory
  986. contains trailing text then you can include that by including the special
  987. column **t** to your selections. The text is always written after any
  988. numerical columns. If you only want to output one word from the trailing
  989. text, then append the word number (0 is the first word). Note that if you
  990. wanted to scale or shift the output values you need to do so during reading,
  991. using the **-i** option. To output all numerical columns and ignoring
  992. trailing text, use **-on**.
  993. .. _option_-p:
  994. Perspective view: The **-p** option
  995. -----------------------------------
  996. All plotting programs that normally produce a flat, two-dimensional
  997. illustration can be told to view this flat illustration from a
  998. particular vantage point, resulting in a perspective view. You can
  999. select perspective view with the **-p** option by setting the azimuth
  1000. and elevation of the viewpoint [Default is 180/90]. When **-p** is used
  1001. in consort with **-Jz** or **-JZ**, a third value can be appended which
  1002. indicates at which *z*-level all 2-D material, like the plot frame, is
  1003. plotted (in perspective) [Default is at the bottom of the z-axis].
  1004. For frames used for animation, we fix the center of your data domain.
  1005. Specify another center using a particular world coordinate point with **+w**\ *lon0*/\ *lat0*\ [/*z0*],
  1006. which will project to the center of your page size, or specify the coordinates of
  1007. the projected 2-D view point with **+v**\ *x0/y0*. When **-p** is used without any further
  1008. arguments, the values from the last use of **-p** in a previous
  1009. GMT command will be used. Alternatively, you can perform a simple rotation
  1010. about the z-axis by just giving the rotation angle. Optionally, use **+v**
  1011. or **+w** to select another axis location than the plot origin.
  1012. .. _option_-q:
  1013. Data row selection: The **-q** option
  1014. -------------------------------------
  1015. Similar to how **-i** and **-o** control which data *columns* to read and write, the **-qi** (or just **-q**)
  1016. and **-qo** options control which data *rows* to read and write [Default is all]. As for columns, you
  1017. can specify specific rows, a range of rows, or several sets of row ranges. You can also
  1018. invert your selections with a leading ~ and then we select all the rows *not* specified by
  1019. your ranges. Normally, the row counter starts at 0 and increases until the end of the
  1020. data set (**+a**). However, you can append **+f** to reset the counter at the start of each
  1021. table (file) or **+s** to reset the counter at the start of each data segment. Thus, **-q**\ 1\ **+s**
  1022. will only read the 2nd data record from each of the segments found. Note that header records do not
  1023. increase the row counters; only data records do. Instead of rows you may specify data
  1024. *limits* for a specified column by appending **+c**\ *col*. Now, we will only select rows whose
  1025. data for the given column *col* lie within the range(s) given by your *min*/*max* limits. Also
  1026. note that when **+c** is used the **+a**\|\ **f**\|\ **s** have no effect.
  1027. .. _option_nodereg:
  1028. Grid registration: The **-r** option
  1029. ------------------------------------
  1030. All 2-D grids in GMT have their nodes
  1031. organized in one of two ways, known as *gridline*- and *pixel*-
  1032. registration. The GMT default is gridline registration; programs that
  1033. allow for the creation of grids can use the **-r** option (or **-rp**) to select
  1034. pixel registration instead. Most observed data tend to be in gridline
  1035. registration while processed data sometime may be distributed in
  1036. pixel registration. While you may convert between the two registrations
  1037. this conversion looses the Nyquist frequency and dampens the other
  1038. high frequencies. It is best to avoid any registration conversion if you
  1039. can help it. Planning ahead may be important.
  1040. Gridline registration
  1041. ^^^^^^^^^^^^^^^^^^^^^
  1042. In this registration, the nodes are centered on the grid line
  1043. intersections and the data points represent the average value in a cell
  1044. of dimensions (:math:`x_{inc} \cdot y_{inc}`) centered on each node
  1045. (left side of Figure :ref:`Grid registration <Grid_registration>`).
  1046. In the case of grid line registration the number of nodes are related
  1047. to region and grid spacing by
  1048. .. math::
  1049. \begin{array}{ccl}
  1050. nx & = & (x_{max} - x_{min}) / x_{inc} + 1 \\
  1051. ny & = & (y_{max} - y_{min}) / y_{inc} + 1
  1052. \end{array}
  1053. which for the example in left side of Figure :ref:`Gridline registration
  1054. <Grid_registration>` yields nx = ny = 4.
  1055. Pixel registration
  1056. ^^^^^^^^^^^^^^^^^^
  1057. Here, the nodes are centered in the grid cells, i.e., the areas
  1058. between grid lines, and the data points represent the average values
  1059. within each cell (right side of Figure :ref:`Grid registration
  1060. <Grid_registration>`). In the case of
  1061. pixel registration the number of nodes are related to region and grid
  1062. spacing by
  1063. .. _Grid_registration:
  1064. .. figure:: /_images/GMT_registration.*
  1065. :width: 500 px
  1066. :align: center
  1067. Gridline- and pixel-registration of data nodes. The red shade indicates the
  1068. areas represented by the value at the node (solid circle).
  1069. .. math::
  1070. \begin{array}{ccl}
  1071. nx & = & (x_{max} - x_{min}) / x_{inc} \\
  1072. ny & = & (y_{max} - y_{min}) / y_{inc}
  1073. \end{array}
  1074. Thus, given the same region (**-R**) and grid spacing, the
  1075. pixel-registered grids have one less column and one less row than the
  1076. gridline-registered grids; here we find nx = ny = 3.
  1077. .. _option_-s:
  1078. NaN-record treatment: The **-s** option
  1079. ---------------------------------------
  1080. We can use this option to suppress output for records whose *z*-value
  1081. equals NaN (by default we output all records). Alternatively, append
  1082. **+r** to reverse the suppression, i.e., only output the records whose
  1083. *z*-value equals NaN. Use **-s+a** to suppress output records where one
  1084. or more fields (and not necessarily *z*) equal NaN. Finally, you can
  1085. supply a comma-separated list of all columns or column ranges to
  1086. consider (before the optional modifiers) for this NaN test.
  1087. .. _option_-t:
  1088. Layer transparency: The **-t** option
  1089. -------------------------------------
  1090. While the PostScript language does not support transparency, PDF does,
  1091. and via PostScript extensions one can manipulate the transparency
  1092. levels of objects. The **-t** option allows you to change the
  1093. transparency level for the current overlay by appending a percentage in
  1094. the 0-100 range; the default is 0, or opaque. Transparency may also be
  1095. controlled on a feature by feature basis when setting color or fill (see
  1096. section :ref:`-Gfill_attrib`). Finally, the modules
  1097. :doc:`/plot`, :doc:`/plot3d`, and :doc:`/text` can all change transparency
  1098. on a record-by-record basis if **-t** is given without argument and the
  1099. input file supplies variable transparencies as the last numerical column value.
  1100. .. _option_-x_core:
  1101. Selecting number of CPU cores: The **-x** option
  1102. ------------------------------------------------
  1103. Specify the number of active cores to be used in any OpenMP-enabled
  1104. multi-threaded algorithms. By default, we try to use all available cores.
  1105. You may append *n* to only use *n* cores (if *n* is too large it will be truncated
  1106. to the maximum number of cores available). Finally, give a negative *n* to select
  1107. all - *n*) cores (but at least one if *n* equals or exceeds all). The **-x**
  1108. option is only available to GMT modules compiled with OpenMP support, with
  1109. the exception of :doc:`/movie` which handles its own parallel execution.
  1110. .. _option_colon:
  1111. Latitude/Longitude or Longitude/Latitude?: The **-:** option
  1112. ------------------------------------------------------------
  1113. For geographical data, the first column is expected to contain
  1114. longitudes and the second to contain latitudes. To reverse this
  1115. expectation you must apply the **-:** option. Optionally, append **i**
  1116. or **o** to restrict the effect to input or output only. Note that
  1117. command line arguments that may take geographic coordinates (e.g.,
  1118. **-R**) *always* expect longitude before latitude. Also, geographical
  1119. grids are expected to have the longitude as first (minor) dimension.
  1120. Footnotes
  1121. ---------
  1122. .. [11]
  1123. The Gregorian Calendar is a revision of the Julian Calendar which was
  1124. instituted in a papal bull by Pope Gregory XIII in 1582. The reason
  1125. for the calendar change was to correct for drift in the dates of
  1126. significant religious observations (primarily Easter) and to prevent
  1127. further drift in the dates. The important effects of the change were
  1128. (a) Drop 10 days from October 1582 to realign the Vernal Equinox with
  1129. 21 March, (b) change leap year selection so that not all years ending
  1130. in "00" are leap years, and (c) change the beginning of the year to 1
  1131. January from 25 March. Adoption of the new calendar was essentially
  1132. immediate within Catholic countries. In the Protestant countries,
  1133. where papal authority was neither recognized not appreciated,
  1134. adoption came more slowly. England finally adopted the new calendar
  1135. in 1752, with eleven days removed from September. The additional day
  1136. came because the old and new calendars disagreed on whether 1700 was
  1137. a leap year, so the Julian calendar had to be adjusted by one more
  1138. day.
  1139. .. [12]
  1140. While UTM coordinates clearly refer to points on the Earth, in this
  1141. context they are considered "other". Thus, when we refer to
  1142. "geographical" coordinates herein we imply longitude, latitude.
  1143. .. [13]
  1144. Please consult the man page for *printf* or any book on C.
  1145. .. [15]
  1146. Ensures that boundary annotations do not fall off the page.
Tip!

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

Comments

Loading...