Skip to content

Commit d9cbd78

Browse files
PaulWesselremkos
authored andcommitted
A variety of rst fixes plus a few code standardizations (#574)
Most of this PR is just improving the RST docs but also fixing mistakes as I find them (typos, formatting error etc). I ran across a few issues that warranted a code update: psmeca and pscoupe had optino syntax that ended in optional f and u. I changed this to +f and +u (backwards compatible) mgd77list had -C for distance calculations, changed to -j talwani3d did not allow user to set latitude for geoid calculations
1 parent 0f5f308 commit d9cbd78

34 files changed

+208
-178
lines changed

doc/rst/source/begin.rst_

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,14 @@ Synopsis
1818
Description
1919
-----------
2020

21-
The **begin** module tells GMT to begin a new modern session. If your script only makes
22-
a single plot then this is the most straightforward way to specify the name
21+
The **begin** module instructs GMT to begin a new modern session. If your script only makes
22+
a single plot then this is the most opportune time to specify the name
2323
and format(s) of your plot. However, if multiple illustrations will be made
24-
then you will need to use :doc:`figure` as well.
24+
then you will instead use :doc:`figure` for each figure you wish to make. The session
25+
keeps track of all default and history settings and isolates them from any other session
26+
that may run concurrently. Thus unlike in classic mode you can run multiple modern sessions
27+
simultaneously without having destructive interference in updating the history of common
28+
options.
2529

2630
Optional Arguments
2731
------------------
@@ -30,12 +34,13 @@ Optional Arguments
3034

3135
*prefix*
3236
Name-stem used to construct the single final figure name. The extension is appended
33-
automatically from your *formats* selection(s) [gmtsession].
37+
automatically from your *formats* selection(s) [gmtsession]. If your script only
38+
performs calculations or needs to make several figures then you will not use this argument.
3439

3540
.. _begin-formats:
3641

3742
*formats*
38-
Give one or more comma-separated graphics extensions from the list of allowable graphics
43+
Give one or more comma-separated graphics extensions from the list of allowable graphics formats
3944
:ref:`formats <tbl-formats>` [pdf].
4045

4146
.. _begin-V:
@@ -90,16 +95,7 @@ are produced then we do not need to give any further arguments:
9095
Should we give such a command and still produce a plot then it will automatically
9196
be called gmtsession.pdf.
9297

93-
Note on PostScript
94-
------------------
95-
96-
If the user selects **ps** as one of the formats, then please be aware that
97-
it is recommended you first set the desired paper size. GMT needs to
98-
work with a fixed paper size since, unlike the **eps** format, there will be
99-
no cropping to BoundingBox. If no paper size is specified via :ref:`PS_MEDIA <PS_MEDIA>`
100-
then GMT will default to A4 and issue a warning; GMT is unable to determine if that
101-
size is adequate for your plot but if the plot width exceeds A4 paper width we will
102-
switch page orientation to landscape.
98+
.. include:: explain_postscript.rst_
10399

104100
See Also
105101
--------

doc/rst/source/clear.rst_

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Description
1919
-----------
2020

2121
The clear command allows users to delete their current history, conf,
22-
or cpt file, remove the entire user cache, data, or sessions directory, or all of the above.
22+
or cpt files, remove the entire user cache, data, or sessions directory, or all of the above.
2323

2424
Optional Arguments
2525
------------------
@@ -32,7 +32,7 @@ Optional Arguments
3232
.. _clear-conf:
3333

3434
*conf*
35-
Delete the current gmt.conf file used for the modern session.
35+
Delete the current gmt.conf file used for the current modern session.
3636

3737
.. _clear-cpt:
3838

@@ -42,12 +42,12 @@ Optional Arguments
4242
.. _clear-cache:
4343

4444
*cache*
45-
Delete the user's cache directory and its contents.
45+
Delete the user's cache directory and all of its contents.
4646

4747
.. _clear-data:
4848

4949
*data*
50-
Delete the user's data download directory and its contents.
50+
Delete the user's data download directory and all of its contents.
5151

5252
.. _clear-history:
5353

doc/rst/source/docs.rst_

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Synopsis
99

1010
.. include:: common_SYN_OPTs.rst_
1111

12-
**gmt docs** [ **-Q** ] *<module-name>* [*-option*]
12+
**gmt docs** [ **-Q** ] *module-name* [*-option*]
1313

1414
|No-spaces|
1515

@@ -18,26 +18,27 @@ Description
1818

1919
**docs** tells GMT to display the HTML version of a module's documentation using the default browser.
2020
For the time being, only modern mode module names are displayed. That is, if user asks for
21-
*gmt docs psxy* she will see the *plot* documentation. Besides the modules names, the special
21+
*gmt docs psxy* she will see the (near-equivalent) *plot* documentation. Besides the modules names, the special
2222
forms *cookbook*, *gallery*, *gmt.conf*, *api* and *tutorial* are also accepted.
2323

24-
However, **docs** can also be used to open local files such as PDF or image files or
24+
However, **docs** can also be used to open local files such as PDF or image files or even
2525
web link addresses.
2626

2727
Optional Arguments
2828
------------------
2929

3030
**-Q**
3131
This option means we are doing a "dry-run" and simply want the final URL to be
32-
printed to standard output. No browser command will take place.
32+
printed to standard output. No browser command will take place. This is useful
33+
if you are working remotely on a server and do not wish to launch a GUI browser.
3334

3435

3536
Optional Module Arguments
3637
-------------------------
3738

3839
*-option*
3940
Where *-option* is the one-letter option of the module in question (e.g, **-R**).
40-
It then displays the documentation positioned at that specific option.
41+
We then display the *module* documentation positioned at that specific option.
4142

4243
Examples
4344
--------
@@ -74,6 +75,12 @@ To see the beautiful figure that I just created with GMT.
7475

7576
gmt docs my_beautiful_figure.pdf
7677

78+
To display the URL to the surface man page,.run
79+
80+
::
81+
82+
gmt docs -Q surface
83+
7784
See Also
7885
--------
7986

doc/rst/source/end.rst_

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ Synopsis
1818
Description
1919
-----------
2020

21-
This **end** module terminates the modern mode and finalizes the processing of all registered
22-
figures. The final graphics will be placed in the current directory.
21+
This **end** module terminates the modern mode session created with **begin** and finalizes the processing of all registered
22+
figures. The final graphics will be placed in the current directory and the hidden sessions directory
23+
will be removed.
2324

2425
Optional Arguments
2526
------------------

doc/rst/source/explain_distcalc.rst_

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
**-je**\ \|\ **f**\ \|\ **g** :ref:`(more ...) <-j_full>`
2-
Determine how spherical distances are calculated. |Add_-j|
1+
**-je**\ \|\ **f**\ \|\ **g** :ref:`(more ...) <distcalc_full>`
2+
Determine how spherical distances are calculated.

doc/rst/source/explain_distcalc_full.rst_

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. _-j_full:
1+
.. _distcalc_full:
22

33
**-je**\ \|\ **f**\ \|\ **g**
44
Determine how spherical distances are calculated in modules that support this.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Note on PostScript
2+
------------------
3+
4+
If the user selects **ps** as one of the formats, then please be aware that
5+
it is recommended you first set the desired paper size. With *ps, GMT needs to
6+
work with a fixed paper size since, unlike the **eps** format, there will be
7+
no cropping to BoundingBox. If no paper size is specified via :ref:`PS_MEDIA <PS_MEDIA>`
8+
then GMT will default to A4 and issue a warning; GMT is unable to determine if that
9+
size is adequate for your plot but if the canvas width exceeds A4 paper width we will
10+
switch page orientation to landscape. For all other formats the final dimension will
11+
be determined automatically.

doc/rst/source/figure.rst_

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,22 @@ Description
1919
-----------
2020

2121
A GMT modern session can make any number of illustrations (including none).
22-
In situations when many illustrations will be made during the session,
23-
the **figure** module specifies the name and format(s) to use for the current plot.
24-
It must be issued before you start plotting to the current figure, and each
22+
In situations when many illustrations will be made during a single session,
23+
the **figure** module is used to specify the name and format(s) to use for the next plot.
24+
It must be issued before you start plotting to the intended figure, and each
2525
new **figure** call changes plotting focus to the next figure. You may go back and forth between
26-
different figure but the optional arguments (*formats* and *options*) can only
26+
different figures but the optional arguments (*formats* and *options*) can only
2727
be given the first time you specify a new figure.
2828
In addition to *prefix* and *formats*, you can supply a comma-separated series of
2929
:doc:`psconvert` options that will override the default settings provided via
30-
:ref:`PS_CONVERT <PS_CONVERT>`. The only other available option controls verbosity.
30+
:ref:`PS_CONVERT <PS_CONVERT>` [**A**]. The only other available options control verbosity
31+
and default parameter settings.
3132

3233
Required Arguments
3334
------------------
3435

3536
*prefix*
36-
Name stem used to construct final figure names, The extension is appended
37+
Name stem used to construct the figure name. The extension(s) are appended
3738
automatically from your *formats* selection(s).
3839

3940
Optional Arguments
@@ -48,8 +49,8 @@ Optional Arguments
4849
.. _figure-options:
4950

5051
*options*
51-
Sets one or more comma-separated options arguments that
52-
can be passed to :doc:`psconvert` when preparing this figure [A].
52+
Sets one or more comma-separated options (and possibly arguments) that
53+
can be passed to :doc:`psconvert` when preparing this figure [**A**].
5354
The valid subset of options are
5455
**A**\ [*args*],\ **C**\ *args*,\ **D**\ *dir*,\ **E**\ *dpi*,\ **H**\ *factor*,\ **M**\ *args*,\ **Q**\ *args*,\ **S**.
5556
See the :doc:`psconvert` documentation for details on these options.
@@ -61,6 +62,8 @@ Optional Arguments
6162

6263
.. include:: explain_help.rst_
6364

65+
.. include:: explain_postscript.rst_
66+
6467
Examples
6568
--------
6669

doc/rst/source/inset.rst_

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
Manage figure inset setup and completion
66

7-
The **inset** module is used to carve out a sub-region of the current plot and
8-
limit further plotting to that section of the canvas. The inset setup is started with the **begin**
9-
mode that defines the placement and size of the inset. Subsequent plot commands will be directed
10-
to that window. The inset is completed via the **end** mode, which reverts operations to the full
11-
canvas and restores the plot region and projection that was in effect prior to the setup of the inset.
7+
The **inset** module is used to carve out a sub-region of the current plot canvas and
8+
restrict further plotting to that section of the canvas. The inset setup is started with the **begin**
9+
directive that defines the placement and size of the inset. Subsequent plot commands will be directed
10+
to that window. The inset is completed via the **end** directive, which reverts operations to the full
11+
canvas and restores the plot region and map projection that was in effect prior to the setup of the inset.
1212

1313
Synopsis (begin mode)
1414
---------------------
@@ -27,8 +27,8 @@ Synopsis (begin mode)
2727
Description
2828
-----------
2929

30-
The **begin** mode of inset defines the dimension and placement of the inset canvas. It
31-
makes a note of the current region and projection so that we may return to the initial
30+
The **begin** directive of **inset** defines the dimension and placement of the inset canvas. It
31+
records the current region and projection so that we may return to the initial
3232
plot environment when the inset is completed.
3333

3434
Required Arguments
@@ -98,8 +98,8 @@ Synopsis (end mode)
9898

9999
**gmt inset end** [ |SYN_OPT-V| ]
100100

101-
This command finalizes the current inset, which returns the plotting environment to
102-
the state prior to the start of the inset. The previous region and projection will be
101+
The **end** directive finalizes the current inset, which returns the plotting environment to
102+
the state prior to the start of the inset. The previous region and map projection will be
103103
in effect going forward.
104104

105105
Optional Arguments
@@ -114,7 +114,7 @@ Optional Arguments
114114
Examples
115115
--------
116116

117-
To make a simple basemap layout with an inset called inset.pdf, try
117+
To make a simple basemap plot called inset.pdf that demonstrates the inset module, try
118118

119119
::
120120

doc/rst/source/subplot.rst_

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
Manage modern mode figure subplot configuration and selection
66

7-
The **subplot** module is used to split the current figure into a matrix of subplots
7+
The **subplot** module is used to split the current figure into a rectangular layout of subplots
88
that each may contain a single panel figure. A subplot setup is started with the **begin**
9-
mode that defines the layout of the subplots, while positioning to a particular panel for
10-
plotting is done via the **set** mode. The subplot is completed via the **end** mode.
9+
directive that defines the layout of the subplots, while positioning to a particular panel for
10+
plotting is done via the **set** directive. The subplot is completed via the **end** directive.
1111

1212
Synopsis (begin mode)
1313
---------------------
@@ -32,8 +32,8 @@ Synopsis (begin mode)
3232
Description
3333
-----------
3434

35-
The **begin** mode of subplot defines the layout of the entire multi-panel illustration. Several
36-
options are available to specify the systematic layout, labeling, dimensions, and more.
35+
The **begin** directive of subplot defines the layout of the entire multi-panel illustration. Several
36+
options are available to specify the systematic layout, labeling, dimensions, and more for the panels.
3737

3838
Required Arguments
3939
------------------
@@ -52,7 +52,7 @@ Required Arguments
5252
a single panel.
5353

5454
**-Ff**
55-
Specify the final figure dimensions. The subplot dimensions are then calculated from the figure
55+
Specify the final **f**igure dimensions. The subplot dimensions are then calculated from the figure
5656
dimensions after accounting for the space that optional tick marks, annotations, labels, and margins occupy between panels.
5757
The annotations, ticks, and labels along the outside perimeter are not counted as part of the figure dimensions.
5858
To specify different subplot dimensions for each row (or column), append **+f** followed by a comma-separated list of width
@@ -61,7 +61,7 @@ Required Arguments
6161
A single number means constant widths (or heights) [Default].
6262

6363
**-Fs**
64-
Specify the dimensions of each subplot directly. Then, the figure dimensions are computed from the
64+
Specify the dimensions of each **s**ubplot directly. Then, the figure dimensions are computed from the
6565
subplot dimensions after adding the space that optional tick marks, annotations, labels, and margins occupy between panels.
6666
The annotations, ticks, and labels along the outside perimeter are not counted as part of the figure dimensions.
6767
To specify different subplot dimensions for each row (or column), append a colon followed by a comma-separated list of widths,
@@ -87,7 +87,7 @@ Optional Arguments
8787
Note: **+j** sets the justification of the tag to *refpoint* (suitable for interior tags)
8888
while **+J** instead selects the mirror opposite (suitable for exterior tags).
8989
Append **+c**\ *dx*\ [/*dy*] to set the clearance between the tag and a surrounding text box
90-
requested via **+g** or **p** [3pt/3pt, i.e., 15% of the :ref:`FONT_TAG size <FONT_TAG>` size].
90+
requested via **+g** or **+p** [3pt/3pt, i.e., 15% of the :ref:`FONT_TAG size <FONT_TAG>` dimension].
9191
Append **+g**\ *fill* to paint the tag's text box with *fill* [no painting].
9292
Append **+o**\ *dx*\ [/*dy*] to offset the tag's reference point in the direction implied
9393
by the justification [4pt/4pt, i.e., 20% of the :ref:`FONT_TAG size <FONT_TAG>`].
@@ -104,7 +104,7 @@ Optional Arguments
104104
Reserve a space of dimension *clearance* between the margin and the subplot on the specified
105105
side, using *side* values from **w**, **e**, **s**, or **n**. The option is repeatable to set aside space
106106
on more than one side. Such space will be left untouched by the main map plotting but can
107-
be accessed by modules that plot scales, bars, text, etc. Settings specified under **begin** mode apply to all panels.
107+
be accessed by modules that plot scales, bars, text, etc. Settings specified under **begin** directive apply to all panels.
108108

109109
.. _-J:
110110

@@ -114,7 +114,7 @@ Optional Arguments
114114
.. _subplot_begin-M:
115115

116116
**-M**\ *margins*
117-
This is clearance that is added around each subplot beyond the automatic space allocated for tick marks,
117+
This is margin space that is added around each subplot beyond the automatic space allocated for tick marks,
118118
annotations, and labels. The margins can be a single value, a pair of values separated by slashes
119119
(for setting separate horizontal and vertical margins), or the full set of four margins (for setting
120120
separate left, right, bottom, and top margins) [0.5c].
@@ -123,20 +123,21 @@ Optional Arguments
123123

124124
.. |Add_-R| unicode:: 0x20 .. just an invisible code
125125
.. include:: explain_-R.rst_
126+
This is useful when all subplots share a common plot domain.
126127

127128
.. _subplot_begin-S:
128129

129130
**-S**\ *layout*
130131
Set subplot layout for shared axes. May be set separately for rows (**-SR**) and columns (**-SC**).
131-
**-SC**: Use when all subplots in a **C**\ olumn share a common *x*-range. The first (i.e., **t**\ op) and the last
132+
Considerations for **-SC**: Use when all subplots in a **C**\ olumn share a common *x*-range. The first (i.e., **t**\ op) and the last
132133
(i.e., **b**\ ottom) rows will have *x* annotations; append **t** or **b** to select only one of those two rows [both].
133134
Append **+l** if annotated *x*-axes should have a label [none]; optionally append the label if it is the same
134135
for the entire subplot.
135-
**-SR**: Use when all subplots in a **R**\ ow share a common *y*-range. The first (i.e., **l**\ eft) and the last
136+
Considerations for **-SR**: Use when all subplots in a **R**\ ow share a common *y*-range. The first (i.e., **l**\ eft) and the last
136137
(i.e., **r**\ ight) columns will have *y*-annotations; append **l** or **r** to select only one of those two columns [both].
137138
Append **+l** if annotated *y*-axes will have a label [none]; optionally, append the label if it is the same
138139
for the entire subplot.
139-
Append **+p** to make all annotations axis-parallel [horizontal]; if used you may have to set **-C** to secure
140+
Append **+p** to make all annotations axis-parallel [horizontal]; if not used you may have to set **-C** to secure
140141
extra space for long horizontal annotations.
141142
Append **+t** to make space for subplot titles for each row; use **+tc** for top row titles only [no subplot titles].
142143
Labels and titles that depends on which row or column are specified as usual via a panel's **-B** setting.
@@ -213,7 +214,7 @@ Synopsis (end mode)
213214

214215
This command finalizes the current subplot, including any placement of tags, and updates the
215216
dimensions of the last plot to that of the entire subplot. This allows **-X** and **-Y** to
216-
use *w* and *h* in setting the current point relative to the entire subplot. We also reset
217+
use the codes *w* and *h* in setting the current point relative to the entire subplot. We also reset
217218
the current plot location to where it was prior to the subplot.
218219

219220
Optional Arguments

doc/rst/source/supplements/img/img2grd.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ Synopsis
1515

1616
**gmt img2grd** *imgfile* |-G|\ *grdfile*
1717
|SYN_OPT-R|
18-
|-T|\ *type*
1918
[ |-C| ]
2019
[ |-D|\ [*minlat/maxlat*] ] [ |-E| ] [ |-I|\ *inc* ]
2120
[ |-M| ] [ |-N|\ *navg* ] [ |-S|\ [*scale*] ]
21+
[ |-T|\ *type* ]
2222
[ |SYN_OPT-V| ]
2323
[ |-W|\ *maxlon* ]
2424
[ |SYN_OPT-n| ]

0 commit comments

Comments
 (0)