Skip to content

Commit aa5f410

Browse files
authored
Merge branch 'main' into test-old-gmt-versions
2 parents a239ac8 + ca5ddbd commit aa5f410

File tree

14 files changed

+80
-77
lines changed

14 files changed

+80
-77
lines changed

examples/tutorials/basics/coastlines.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
# 4. lake-in-island-in-lake shore
2929
#
3030
# You can specify which level you want to plot by passing the level number and
31-
# a GMT pen configuration. For example, to plot just the coastlines with 0.5
31+
# a GMT pen configuration. For example, to plot just the coastlines with 0.5p
3232
# thickness and black lines:
3333

3434
fig = pygmt.Figure()

pygmt/datasets/earth_age.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,19 @@ def load_earth_age(resolution="01d", region=None, registration=None):
3232
----------
3333
resolution : str
3434
The grid resolution. The suffix ``d`` and ``m`` stand for
35-
arc-degree, arc-minute and arc-second. It can be ``'01d'``, ``'30m'``,
36-
``'20m'``, ``'15m'``, ``'10m'``, ``'06m'``, ``'05m'``, ``'04m'``,
37-
``'03m'``, ``'02m'``, or ``'01m'``.
35+
arc-degree and arc-minute. It can be ``"01d"``, ``"30m"``,
36+
``"20m"``, ``"15m"``, ``"10m"``, ``"06m"``, ``"05m"``, ``"04m"``,
37+
``"03m"``, ``"02m"``, or ``"01m"``.
3838
3939
region : str or list
4040
The subregion of the grid to load, in the forms of a list
4141
[*xmin*, *xmax*, *ymin*, *ymax*] or a string *xmin/xmax/ymin/ymax*.
4242
Required for grids with resolutions higher than 5
43-
arc-minute (i.e., ``05m``).
43+
arc-minute (i.e., ``"05m"``).
4444
4545
registration : str
46-
Grid registration type. Either ``pixel`` for pixel registration or
47-
``gridline`` for gridline registration. Default is ``None``, where
46+
Grid registration type. Either ``"pixel"`` for pixel registration or
47+
``"gridline"`` for gridline registration. Default is ``None``, where
4848
a pixel-registered grid is returned unless only the
4949
gridline-registered grid is available.
5050

pygmt/datasets/earth_relief.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,31 +32,31 @@ def load_earth_relief(resolution="01d", region=None, registration=None, use_srtm
3232
----------
3333
resolution : str
3434
The grid resolution. The suffix ``d``, ``m`` and ``s`` stand for
35-
arc-degree, arc-minute and arc-second. It can be ``'01d'``, ``'30m'``,
36-
``'20m'``, ``'15m'``, ``'10m'``, ``'06m'``, ``'05m'``, ``'04m'``,
37-
``'03m'``, ``'02m'``, ``'01m'``, ``'30s'``, ``'15s'``, ``'03s'``,
38-
or ``'01s'``.
35+
arc-degree, arc-minute and arc-second. It can be ``"01d"``, ``"30m"``,
36+
``"20m"``, ``"15m"``, ``"10m"``, ``"06m"``, ``"05m"``, ``"04m"``,
37+
``"03m"``, ``"02m"``, ``"01m"``, ``"30s"``, ``"15s"``, ``"03s"``,
38+
or ``"01s"``.
3939
4040
region : str or list
4141
The subregion of the grid to load, in the forms of a list
4242
[*xmin*, *xmax*, *ymin*, *ymax*] or a string *xmin/xmax/ymin/ymax*.
4343
Required for Earth relief grids with resolutions higher than 5
44-
arc-minute (i.e., ``05m``).
44+
arc-minute (i.e., ``"05m"``).
4545
4646
registration : str
47-
Grid registration type. Either ``pixel`` for pixel registration or
48-
``gridline`` for gridline registration. Default is ``None``, where
47+
Grid registration type. Either ``"pixel"`` for pixel registration or
48+
``"gridline"`` for gridline registration. Default is ``None``, where
4949
a gridline-registered grid is returned unless only the pixel-registered
5050
grid is available.
5151
52-
**Note:** For GMT 6.3, ``registration=None`` returns a pixel-registered
52+
**Note**: For GMT 6.3, ``registration=None`` returns a pixel-registered
5353
grid by default unless only the gridline-registered grid is available.
5454
5555
use_srtm : bool
5656
By default, the land-only SRTM tiles from NASA are used to generate the
57-
``'03s'`` and ``'01s'`` grids, and the missing ocean values are filled
57+
``"03s"`` and ``"01s"`` grids, and the missing ocean values are filled
5858
by up-sampling the SRTM15+ tiles which have a resolution of 15
59-
arc-second (i.e., ``'15s'``). If True, will only load the original
59+
arc-second (i.e., ``"15s"``). If True, will only load the original
6060
land-only SRTM tiles.
6161
6262
Returns

pygmt/figure.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,9 @@ class Figure:
5959
Examples
6060
--------
6161
62-
>>> fig = Figure()
63-
>>> fig.basemap(region=[0, 360, -90, 90], projection="W7i", frame=True)
62+
>>> import pygmt
63+
>>> fig = pygmt.Figure()
64+
>>> fig.basemap(region=[0, 360, -90, 90], projection="W15c", frame=True)
6465
>>> fig.savefig("my-figure.png")
6566
>>> # Make sure the figure file is generated and clean it up
6667
>>> import os
@@ -71,8 +72,9 @@ class Figure:
7172
The plot region can be specified through ISO country codes (for example,
7273
``'JP'`` for Japan):
7374
74-
>>> fig = Figure()
75-
>>> fig.basemap(region="JP", projection="M3i", frame=True)
75+
>>> import pygmt
76+
>>> fig = pygmt.Figure()
77+
>>> fig.basemap(region="JP", projection="M7c", frame=True)
7678
>>> # The fig.region attribute shows the WESN bounding box for the figure
7779
>>> print(", ".join(f"{i:.2f}" for i in fig.region))
7880
122.94, 145.82, 20.53, 45.52

pygmt/helpers/decorators.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,9 +309,9 @@
309309
text, add the column **t**. Append the word number to **t** to
310310
write only a single word from the trailing text. Instead of
311311
specifying columns, use ``outcols="n"`` to simply read numerical
312-
input and skip trailing text. Note: if ``incols`` is also used
313-
then the columns given to ``outcols`` correspond to the order
314-
after the ``incols`` selection has taken place.""",
312+
input and skip trailing text. *Note**: If ``incols`` is also
313+
used then the columns given to ``outcols`` correspond to the
314+
order after the ``incols`` selection has taken place.""",
315315
"p": r"""
316316
perspective : list or str
317317
[**x**\|\ **y**\|\ **z**]\ *azim*\[/*elev*\[/*zlevel*]]\

pygmt/src/grd2cpt.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ def grd2cpt(grid, **kwargs):
8686
background : bool or str
8787
Select the back- and foreground colors to match the colors for lowest
8888
and highest *z*-values in the output CPT [Default (``background=True``
89-
or ``background='o'``) uses the colors specified in the master file, or
89+
or ``background="o"``) uses the colors specified in the master file, or
9090
those defined by the parameters :gmt-term:`COLOR_BACKGROUND`,
9191
:gmt-term:`COLOR_FOREGROUND`, and :gmt-term:`COLOR_NAN`]. Use
92-
``background='i'`` to match the colors for the lowest and highest
92+
``background="i"`` to match the colors for the lowest and highest
9393
values in the input (instead of the output) CPT.
9494
color_model :
9595
[**R**\|\ **r**\|\ **h**\|\ **c**][**+c**\ [*label*]].
@@ -124,7 +124,7 @@ def grd2cpt(grid, **kwargs):
124124
also :gmt-docs:`cookbook/features.html#manipulating-cpts`.
125125
output : str
126126
Optional parameter to set the file name with extension .cpt to store
127-
the generated CPT file. If not given or False (Default), saves the CPT
127+
the generated CPT file. If not given or False [Default], saves the CPT
128128
as the session current CPT.
129129
reverse : str
130130
Set this to True or c [Default] to reverse the sense of color
@@ -153,7 +153,7 @@ def grd2cpt(grid, **kwargs):
153153
Do not interpolate the input color table but pick the output colors
154154
starting at the beginning of the color table, until colors for all
155155
intervals are assigned. This is particularly useful in combination with
156-
a categorical color table, like ``cmap='categorical'``.
156+
a categorical color table, like ``cmap="categorical"``.
157157
cyclic : bool
158158
Produce a wrapped (cyclic) color table that endlessly repeats its
159159
range. Note that ``cyclic=True`` cannot be set together with

pygmt/src/grdimage.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,10 @@ def grdimage(self, grid, **kwargs):
9595
drivers. Append a **+c**\ *args* string where *args* is a list
9696
of one or more concatenated number of GDAL **-co** arguments. For
9797
example, to write a GeoPDF with the TerraGo format use
98-
``=PDF+cGEO_ENCODING=OGC_BP``. Notes: (1) If a tiff file (.tif) is
99-
selected then we will write a GeoTiff image if the GMT projection
100-
syntax translates into a PROJ syntax, otherwise a plain tiff file
101-
is produced. (2) Any vector elements will be lost.
98+
``=PDF+cGEO_ENCODING=OGC_BP``. **Notes**: (1) If a tiff file (.tif)
99+
is selected then we will write a GeoTiff image if the GMT
100+
projection syntax translates into a PROJ syntax, otherwise a plain
101+
tiff file is produced. (2) Any vector elements will be lost.
102102
{B}
103103
{CPT}
104104
img_in : str
@@ -138,9 +138,9 @@ def grdimage(self, grid, **kwargs):
138138
want a more specific intensity scenario then run
139139
:func:`pygmt.grdgradient` separately first. If we should derive
140140
intensities from another file than grid, specify the file with
141-
suitable modifiers [Default is no illumination]. Note: If the input
142-
data is an *image* then an *intensfile* or constant *intensity* must
143-
be provided.
141+
suitable modifiers [Default is no illumination]. **Note**: If the
142+
input data is an *image* then an *intensfile* or constant *intensity*
143+
must be provided.
144144
{J}
145145
monochrome : bool
146146
Force conversion to monochrome image using the (television) YIQ

pygmt/src/image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def image(self, imagefile, **kwargs):
3838
This must be an Encapsulated PostScript (EPS) file or a raster
3939
image. An EPS file must contain an appropriate BoundingBox. A
4040
raster file can have a depth of 1, 8, 24, or 32 bits and is read
41-
via GDAL. Note: If GDAL was not configured during GMT installation
41+
via GDAL. **Note**: If GDAL was not configured during GMT installation
4242
then only EPS files are supported.
4343
{J}
4444
{R}

pygmt/src/makecpt.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,19 +66,19 @@ def makecpt(**kwargs):
6666
----------
6767
transparency : str
6868
Sets a constant level of transparency (0-100) for all color slices.
69-
Append **+a** to also affect the fore-, back-, and nan-colors
70-
[Default is no transparency, i.e., 0 (opaque)].
69+
Append **+a** to also affect the foreground, background, and NaN
70+
colors [Default is no transparency, i.e., 0 (opaque)].
7171
cmap : str
7272
Selects the master color palette table (CPT) to use in the
7373
interpolation. Full list of built-in color palette tables can be found
7474
at :gmt-docs:`cookbook/cpts.html#built-in-color-palette-tables-cpt`.
7575
background : bool or str
7676
Select the back- and foreground colors to match the colors for lowest
7777
and highest *z*-values in the output CPT [Default (``background=True``
78-
or ``background='o'``) uses the colors specified in the master file, or
78+
or ``background="o"``) uses the colors specified in the master file, or
7979
those defined by the parameters :gmt-term:`COLOR_BACKGROUND`,
8080
:gmt-term:`COLOR_FOREGROUND`, and :gmt-term:`COLOR_NAN`]. Use
81-
``background='i'`` to match the colors for the lowest and highest
81+
``background="i"`` to match the colors for the lowest and highest
8282
values in the input (instead of the output) CPT.
8383
color_model :
8484
[**R**\|\ **r**\|\ **h**\|\ **c**][**+c**\ [*label*]].
@@ -89,9 +89,9 @@ def makecpt(**kwargs):
8989
appended then we create labels for each category to be used when the
9090
CPT is plotted. The *label* may be a comma-separated list of category
9191
names (you can skip a category by not giving a name), or give
92-
*start*[-], where we automatically build monotonically increasing
93-
labels from *start* (a single letter or an integer). Append - to build
94-
ranges *start*-*start+1* instead.
92+
*start*\[**-**], where we automatically build monotonically increasing
93+
labels from *start* (a single letter or an integer). Append **-** to
94+
build ranges *start*-*start+1* instead.
9595
series : list or str
9696
[*min/max/inc*\[**+b**\|\ **l**\|\ **n**]\|\ *file*\|\ *list*].
9797
Defines the range of the new CPT by giving the lowest and highest
@@ -110,10 +110,10 @@ def makecpt(**kwargs):
110110
also :gmt-docs:`cookbook/features.html#manipulating-cpts`.
111111
output : str
112112
Optional. The file name with extension .cpt to store the generated CPT
113-
file. If not given or False (default), saves the CPT as the session
113+
file. If not given or False [Default], saves the CPT as the session
114114
current CPT.
115115
reverse : str
116-
Set this to True or **c**\ [Default] to reverse the sense of color
116+
Set this to True or **c** [Default] to reverse the sense of color
117117
progression in the master CPT. Set this to z to reverse the sign of
118118
z-values in the color table. Note that this change of z-direction
119119
happens before ``truncate`` and ``series`` values are used so the
@@ -140,7 +140,7 @@ def makecpt(**kwargs):
140140
Do not interpolate the input color table but pick the output colors
141141
starting at the beginning of the color table, until colors for all
142142
intervals are assigned. This is particularly useful in combination with
143-
a categorical color table, like ``cmap='categorical'``.
143+
a categorical color table, like ``cmap="categorical"``.
144144
cyclic : bool
145145
Produce a wrapped (cyclic) color table that endlessly repeats its
146146
range. Note that ``cyclic=True`` cannot be set together with

pygmt/src/project.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def project(data=None, x=None, y=None, z=None, outfile=None, **kwargs):
141141
end point cannot be farther apart than :math:`2|\mbox{{colat}}|`.
142142
Finally, if you append **+h** then we will report the position of
143143
the pole as part of the segment header [Default is no header].
144-
Note: No input is read and the value of ``data``, ``x``, ``y``,
144+
**Note**: No input is read and the value of ``data``, ``x``, ``y``,
145145
and ``z`` is ignored if ``generate`` is used.
146146
147147
length : str or list

pygmt/src/subplot.py

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ def subplot(self, nrows=1, ncols=1, **kwargs):
6969
follow sequentially. Surround the number or letter by parentheses on
7070
any side if these should be typeset as part of the tag. Use
7171
**+j**\|\ **J**\ *refpoint* to specify where the tag should be placed
72-
in the subplot [TL]. Note: **+j** sets the justification of the tag to
73-
*refpoint* (suitable for interior tags) while **+J** instead selects
74-
the mirror opposite (suitable for exterior tags). Append
72+
in the subplot [TL]. **Note**: **+j** sets the justification of the
73+
tag to *refpoint* (suitable for interior tags) while **+J** instead
74+
selects the mirror opposite (suitable for exterior tags). Append
7575
**+c**\ *dx*\[/*dy*] to set the clearance between the tag and a
7676
surrounding text box requested via **+g** or **+p** [3p/3p, i.e., 15%
7777
of the :gmt-term:`FONT_TAG` size dimension]. Append **+g**\ *fill* to
@@ -89,23 +89,24 @@ def subplot(self, nrows=1, ncols=1, **kwargs):
8989
Reserve a space of dimension *clearance* between the margin and the
9090
subplot on the specified side, using *side* values from **w**, **e**,
9191
**s**, or **n**; or **x** for both **w** and **e**; or **y** for both
92-
**s** and **n**. No *side* means all sides (i.e. ``clearance='1c'``
92+
**s** and **n**. No *side* means all sides (i.e. ``clearance="1c"``
9393
would set a clearance of 1 cm on all sides). The option is repeatable
94-
to set aside space on more than one side (e.g. ``clearance=['w1c',
95-
's2c']`` would set a clearance of 1 cm on west side and 2 cm on south
96-
side). Such space will be left untouched by the main map plotting but
97-
can be accessed by methods that plot scales, bars, text, etc.
94+
to set aside space on more than one side (e.g.
95+
``clearance=["w1c", "s2c"]`` would set a clearance of 1 cm on west
96+
side and 2 cm on south side). Such space will be left untouched by
97+
the main map plotting but can be accessed by methods that plot
98+
scales, bars, text, etc.
9899
{J}
99100
margins : str or list
100101
This is margin space that is added between neighboring subplots (i.e.,
101102
the interior margins) in addition to the automatic space added for tick
102103
marks, annotations, and labels. The margins can be specified as either:
103104
104-
- a single value (for same margin on all sides). E.g. '5c'.
105+
- a single value (for same margin on all sides). E.g. ``"5c"``.
105106
- a pair of values (for setting separate horizontal and vertical
106-
margins). E.g. ['5c', '3c'].
107+
margins). E.g. ``["5c", "3c"]``.
107108
- a set of four values (for setting separate left, right, bottom, and
108-
top margins). E.g. ['1c', '2c', '3c', '4c'].
109+
top margins). E.g. ``["1c", "2c", "3c", "4c"]``.
109110
110111
The actual gap created is always a sum of the margins for the two
111112
opposing sides (e.g., east plus west or south plus north margins)
@@ -116,7 +117,7 @@ def subplot(self, nrows=1, ncols=1, **kwargs):
116117
Set subplot layout for shared x-axes. Use when all subplots in a column
117118
share a common *x*-range. If ``sharex=True``, the first (i.e.,
118119
**t**\ op) and the last (i.e., **b**\ ottom) rows will have
119-
*x*-annotations; use ``sharex='t'`` or ``sharex='b'`` to select only
120+
*x*-annotations; use ``sharex="t"`` or ``sharex="b"`` to select only
120121
one of those two rows [both]. Append **+l** if annotated *x*-axes
121122
should have a label [none]; optionally append the label if it is the
122123
same for the entire subplot. Append **+t** to make space for subplot
@@ -126,7 +127,7 @@ def subplot(self, nrows=1, ncols=1, **kwargs):
126127
Set subplot layout for shared y-axes. Use when all subplots in a row
127128
share a common *y*-range. If ``sharey=True``, the first (i.e.,
128129
**l**\ eft) and the last (i.e., **r**\ ight) columns will have
129-
*y*-annotations; use ``sharey='l'`` or ``sharey='r'`` to select only
130+
*y*-annotations; use ``sharey="l"`` or ``sharey="r"`` to select only
130131
one of those two columns [both]. Append **+l** if annotated *y*-axes
131132
will have a label [none]; optionally, append the label if it is the
132133
same for the entire subplot. Append **+p** to make all annotations
@@ -173,13 +174,13 @@ def set_panel(self, panel=None, **kwargs):
173174
r"""
174175
Set the current subplot panel to plot on.
175176
176-
Before you start plotting you must first select the active subplot. Note:
177-
If any *projection* option is passed with the question mark **?** as scale
178-
or width when plotting subplots, then the dimensions of the map are
179-
automatically determined by the subplot size and your region. For Cartesian
180-
plots: If you want the scale to apply equally to both dimensions then you
181-
must specify ``projection="x"`` [The default ``projection="X"`` will fill
182-
the subplot by using unequal scales].
177+
Before you start plotting you must first select the active subplot.
178+
**Note**: If any *projection* option is passed with the question mark
179+
**?** as scale or width when plotting subplots, then the dimensions of
180+
the map are automatically determined by the subplot size and your
181+
region. For Cartesian plots: If you want the scale to apply equally to
182+
both dimensions then you must specify ``projection="x"`` [The default
183+
``projection="X"`` will fill the subplot by using unequal scales].
183184
184185
{aliases}
185186
@@ -208,7 +209,7 @@ def set_panel(self, panel=None, **kwargs):
208209
Reserve a space of dimension *clearance* between the margin and the
209210
subplot on the specified side, using *side* values from **w**, **e**,
210211
**s**, or **n**. The option is repeatable to set aside space on more
211-
than one side (e.g. ``clearance=['w1c', 's2c']`` would set a clearance
212+
than one side (e.g. ``clearance=["w1c", "s2c"]`` would set a clearance
212213
of 1 cm on west side and 2 cm on south side). Such space will be left
213214
untouched by the main map plotting but can be accessed by methods that
214215
plot scales, bars, text, etc. This setting overrides the common

0 commit comments

Comments
 (0)