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

begin.rst 5.2 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
  1. .. index:: ! begin
  2. .. include:: module_core_purpose.rst_
  3. *****
  4. begin
  5. *****
  6. |begin_purpose|
  7. Synopsis
  8. --------
  9. .. include:: common_SYN_OPTs.rst_
  10. **gmt begin** [*prefix*] [*formats*] [*options*]
  11. [ |-C| ]
  12. [ |SYN_OPT-V| ]
  13. |No-spaces|
  14. Description
  15. -----------
  16. The **begin** module instructs GMT to begin a new modern mode session. If your script only makes
  17. a single plot then this is the most opportune time to specify the name
  18. and format(s) of your plot. However, if you want to create multiple illustrations within this session,
  19. you will instead use :doc:`figure` to name the figure(s) you wish to make. The session
  20. keeps track of all default and history settings and isolates them from any other session
  21. that may run concurrently. Thus, unlike classic mode, you can run multiple modern sessions
  22. simultaneously without having destructive interference in updating the history of common
  23. options.
  24. In addition to *prefix* and *formats*, you can supply a comma-separated series of
  25. :doc:`psconvert` *options* (without their leading hyphens) that will override the default settings provided via
  26. :term:`PS_CONVERT` [**A**]. The only other available options control the verbosity.
  27. Optional Arguments
  28. ------------------
  29. .. _begin-prefix:
  30. *prefix*
  31. Name-stem used to construct the single final figure name [gmtsession]. The extension is appended
  32. automatically from your *formats* selection(s). If your script only
  33. performs calculations or needs to make several figures then you will not use this argument.
  34. While not recommended, if your *prefix* has spaces in it then you must enclose your
  35. prefix in single or double quotes.
  36. .. _begin-formats:
  37. *formats*
  38. Give one or more comma-separated graphics extensions from the list of allowable
  39. :ref:`graphics formats <tbl-formats>`
  40. (default format is configurable via setting :term:`GMT_GRAPHICS_FORMAT` [pdf]).
  41. .. _begin-options:
  42. *options*
  43. Sets one or more comma-separated options (and possibly arguments) that
  44. can be passed to :doc:`psconvert` when preparing a session figure [**A**].
  45. The valid subset of options are
  46. **A**\ [*args*],\ **C**\ *args*,\ **D**\ *dir*,\ **E**\ *dpi*,\ **H**\ *factor*,\ **M**\ *args*,\ **Q**\ *args*,\ **S**.
  47. Note that the leading hyphens should not be given.
  48. See the :doc:`psconvert` documentation for details on these options.
  49. .. _-C:
  50. **-C**
  51. Start this session with a clean slate: Any gmt.conf files in the usual search path
  52. directories are ignored [Default starts session with the prevailing user settings].
  53. .. _-V:
  54. .. |Add_-V| unicode:: 0x20 .. just an invisible code
  55. .. include:: explain_-V.rst_
  56. .. include:: explain_help_nopar.rst_
  57. Supported Graphic Formats
  58. -------------------------
  59. .. _tbl-formats:
  60. ====== ====================================================
  61. Format Explanation
  62. ====== ====================================================
  63. bmp Microsoft Bit Map
  64. eps Encapsulated PostScript
  65. jpg Joint Photographic Experts Group Format
  66. pdf Portable Document Format [Default]
  67. png Portable Network Graphics
  68. PNG Portable Network Graphics (with transparency layer)
  69. ppm Portable Pixel Map
  70. ps Plain PostScript
  71. tif Tagged Image Format File
  72. ====== ====================================================
  73. Examples
  74. --------
  75. To initiate a new modern session that will produce a single
  76. map called Figure_2 saved as both a PDF vector graphics file
  77. and an opaque PNG raster image, we would start our script thus::
  78. gmt begin Figure_2 pdf,png
  79. If the modern session is only used for computations and no illustrations
  80. are produced then we do not need to give any further arguments::
  81. gmt begin
  82. Should we give such a command and still produce a plot then it will automatically
  83. be called gmtsession.pdf (assuming :term:`GMT_GRAPHICS_FORMAT` is pdf).
  84. To set up proceedings for a jpg figure with 0.5c white margin, and strictly using
  85. the GMT default settings, we would run::
  86. gmt begin 'My Figure4' jpg A+m0.5c -C
  87. .. include:: explain_postscript.rst_
  88. Note on UNIX shells
  89. -------------------
  90. Modern mode works by communicating across gmt modules via the shell script's (or terminal's)
  91. process ID, which is the common parent process ID (PPID) for each module. This number is used to
  92. create the unique session directories where gmt keeps its book-keeping records. However, inconsistencies
  93. across various UNIX shells and other differences in their implementations may occasionally lead
  94. to problems for gmt to properly determine the unique PPID. The most common situation is
  95. related to a shell spawning sub-shells when you are linking two or more processes via UNIX pipes.
  96. Each sub-shell will then have its own process ID and gmt modules started by the sub-shell will then
  97. have that ID as PPID and it will differ from the one determined by gmt begin.
  98. If you are using pipes in your modern mode script and you get strange errors about not finding gmt_session.#####
  99. then you can add this command to the top of your script to make the issue go away (in Bourne shell)::
  100. export GMT_SESSION_NAME=$$
  101. or in C shell::
  102. setenv GMT_SESSION_NAME $$
  103. This setting is prescribed if you create a new script with ``gmt --new-script``.
  104. See Also
  105. --------
  106. :doc:`clear`,
  107. :doc:`docs`,
  108. :doc:`end`,
  109. :doc:`figure`,
  110. :doc:`inset`,
  111. :doc:`subplot`,
  112. :doc:`gmt`
Tip!

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

Comments

Loading...