Skip to content

Commit 34b30aa

Browse files
willschlitzerMeghan Jones
and
Meghan Jones
authored
Replace argument with parameter in gallery examples and tutorials (#943)
Co-authored-by: Meghan Jones <[email protected]>
1 parent c93517a commit 34b30aa

24 files changed

+82
-78
lines changed

examples/gallery/coast/borders.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
Political Boundaries
33
--------------------
44
5-
The ``borders`` argument of :meth:`pygmt.Figure.coast` specifies levels of political
5+
The ``borders`` parameter of :meth:`pygmt.Figure.coast` specifies levels of political
66
boundaries to plot and the pen used to draw them. Choose from the list of boundaries
77
below:
88
9-
* 1 = National boundaries
10-
* 2 = State boundaries within the Americas
11-
* 3 = Marine boundaries
12-
* a = All boundaries (1-3)
9+
* **1** = National boundaries
10+
* **2** = State boundaries within the Americas
11+
* **3** = Marine boundaries
12+
* **a** = All boundaries (1-3)
1313
1414
For example, to draw national boundaries with 1p thickness black lines use
1515
``borders="1/1p,black"``. You can draw multiple boundaries by passing in a list to

examples/gallery/coast/land_and_water.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Color land and water
33
--------------------
44
5-
The ``land`` and ``water`` arguments of :meth:`pygmt.Figure.coast` specify a color to
5+
The ``land`` and ``water`` parameters of :meth:`pygmt.Figure.coast` specify a color to
66
fill in the land and water masses, respectively. You can use standard GMT color names or
77
give a hex value (like ``#333333``).
88
"""

examples/gallery/grid/grdview_surface.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44
55
The :meth:`pygmt.Figure.grdview()` method can plot 3-D surfaces with ``surftype="s"``. Here,
66
we supply the data as an :class:`xarray.DataArray` with the coordinate vectors ``x`` and
7-
``y`` defined. Note that the ``perspective`` argument here controls the azimuth and
8-
elevation angle of the view. We provide a list of two arguments to ``frame`` — the
7+
``y`` defined. Note that the ``perspective`` parameter here controls the azimuth and
8+
elevation angle of the view. We provide a list of two arguments to ``frame`` - the
9+
first argument specifies the :math:`x`- and :math:`y`:-axes frame attributes and the
910
second argument, prepended with ``"z"``, specifies the :math:`z`-axis frame attributes.
10-
Specifying the same scale for the ``projection`` and ``zcale`` arguments ensures equal
11-
axis scaling. The ``shading`` argument specifies illumination; here we choose an azimuth of
11+
Specifying the same scale for the ``projection`` and ``zcale`` parameters ensures equal
12+
axis scaling. The ``shading`` parameter specifies illumination; here we choose an azimuth of
1213
45° with ``shading="+a45"``.
1314
"""
1415

examples/gallery/grid/track_sampling.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
55
The :func:`pygmt.grdtrack` function samples a raster grid's value along specified
66
points. We will need to input a 2D raster to ``grid`` which can be an
7-
:class:`xarray.DataArray`. The ``points`` argument can be a :class:`pandas.DataFrame` table where
8-
the first two columns are x and y (or longitude and latitude). Note also that there is a
9-
``newcolname`` argument that will be used to name the new column of values we sampled
10-
from the grid.
7+
:class:`xarray.DataArray`. The argument passed to the ``points`` parameter can be a
8+
:class:`pandas.DataFrame` table where the first two columns are x and y (or longitude
9+
and latitude). Note also that there is a ``newcolname`` parameter that will be used to
10+
name the new column of values sampled from the grid.
1111
12-
Alternatively, we can provide a NetCDF file path to ``grid``. An ASCII file path can
13-
also be accepted for ``points``, but an ``outfile`` argument will then need to be set
14-
to name the resulting output ASCII file.
12+
Alternatively, a NetCDF file path can be passed to ``grid``. An ASCII file path can
13+
also be accepted for ``points``. To save an output ASCII file, a file name argument
14+
needs to be passed to the ``outfile`` parameter.
1515
"""
1616

1717
import pygmt

examples/gallery/line/line-custom-cpt.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
-----------------------------
44
55
The color of the lines made by :meth:`pygmt.Figure.plot` can be set according to a
6-
custom CPT and assigned with the ``pen`` argument.
6+
custom CPT and assigned with the ``pen`` parameter.
77
8-
The custom CPT can be used by setting the plot command's ``cmap`` argument to ``True``. The
9-
``zvalue`` argument sets the z-value (color) to be used from the custom CPT, and the line
10-
color is set as the z-value by using **+z** when setting the ``pen`` color.
8+
The custom CPT can be used by setting the plot command's ``cmap`` parameter to
9+
``True``. The ``zvalue`` parameter sets the z-value (color) to be used from the custom
10+
CPT, and the line color is set as the z-value by using **+z** when setting the ``pen``
11+
color.
1112
1213
"""
1314

examples/gallery/line/linestyles.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
The :meth:`pygmt.Figure.plot` method can plot lines in different styles.
66
The default line style is a 0.25-point wide, black, solid line, and can be
7-
customized via the ``pen`` argument.
7+
customized with the ``pen`` parameter.
88
99
A *pen* in GMT has three attributes: *width*, *color*, and *style*.
1010
The *style* attribute controls the appearance of the line.

examples/gallery/plot/colorbar.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
--------
44
55
The :meth:`pygmt.Figure.colorbar` method creates a color scalebar. We must
6-
specify the colormap via the ``cmap`` argument, and optionally set the
7-
placement via the ``position`` argument. The full list of color palette tables
6+
specify the colormap via the ``cmap`` parameter, and optionally set the
7+
placement via the ``position`` parameter. The full list of color palette tables
88
can be found at :gmt-docs:`cookbook/cpts.html`. You can set the ``position`` of
99
the colorbar using the following options:
1010
@@ -18,7 +18,7 @@
1818
point.
1919
- **n**: using normalized (0-1) coordinates, e.g. ``position="n0.4/0.8"``.
2020
21-
Note that the anchor point defaults to the bottom left (BL). Append ``+h`` to
21+
Note that the anchor point defaults to the bottom left (**BL**). Append ``+h`` to
2222
``position`` to get a horizontal colorbar instead of a vertical one.
2323
"""
2424
import pygmt
@@ -49,7 +49,8 @@
4949
# with a length/width (+w) of 7cm by 0.5cm and a box for NaN values (+n)
5050
position="JMR+o1c/0c+w7c/0.5c+n+mc",
5151
# Note that the label 'Elevation' is moved to the opposite side and plotted
52-
# vertically as a column of text using '+mc' in the position argument above
52+
# vertically as a column of text using '+mc' in the position parameter
53+
# above
5354
frame=["x+lElevation", "y+lm"],
5455
scale=10,
5556
)

examples/gallery/plot/image.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
The :meth:`pygmt.Figure.image` method can be used to read and
55
place a raster image file or an Encapsulated PostScript file
66
on a map. We must specify the file as *str* via the ``imagefile``
7-
argument or simply use the filename as the first argument. You can
7+
parameter or simply use the filename as the first argument. You can
88
also use a full URL pointing to your desired image. The ``position``
9-
argument allows us to set a reference point on the map for the image.
9+
parameter allows us to set a reference point on the map for the image.
1010
1111
"""
1212
import os
@@ -25,7 +25,7 @@
2525
box=True,
2626
)
2727

28-
# clean up the image downloaded in the current directory
28+
# clean up the downloaded image in the current directory
2929
os.remove("gmt-logo.png")
3030

3131
fig.show()

examples/gallery/plot/legend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
The :meth:`pygmt.Figure.legend` method can automatically create a legend for
66
symbols plotted using :meth:`pygmt.Figure.plot`. Legend entries are only
7-
created when the ``label`` argument is used.
7+
created when the ``label`` parameter is used.
88
"""
99
import pygmt
1010

examples/gallery/plot/meca.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
55
The :meth:`pygmt.Figure.meca` method can plot focal mechanisms, or beachballs.
66
We can specify the focal mechanism nodal planes or moment tensor components as
7-
a dict using the ``spec`` argument (or they can be specified as a 1d or 2d array,
7+
a dict using the ``spec`` parameter (or they can be specified as a 1d or 2d array,
88
or within a specified file). The size of plotted beachballs can be specified
9-
using the ``scale`` argument.
9+
using the ``scale`` parameter.
1010
"""
1111

1212
import pygmt

examples/gallery/plot/multi-parameter-symbols.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
-------------------------
44
55
The :meth:`pygmt.Figure.plot` method can plot individual multi-parameter symbols by passing
6-
the corresponding shortcuts listed below to the ``style`` argument. Additionally, we must define
6+
the corresponding shortcuts listed below to the ``style`` parameter. Additionally, we must define
77
the required parameters in a 2d list or numpy array (``[[parameters]]`` for a single symbol
88
or ``[[parameters_1],[parameters_2],[parameters_i]]`` for several ones) or use an
99
appropriately formatted input file and pass it to ``data``.

examples/gallery/plot/points-transparency.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
Points with varying transparency
33
--------------------------------
44
5-
Points can be plotted with different transparency levels by passing in an array to the
6-
``transparency`` argument of :meth:`pygmt.Figure.plot`.
5+
Points can be plotted with different transparency levels by passing in an array
6+
argument to the ``transparency`` parameter of :meth:`pygmt.Figure.plot`.
77
"""
88

99
import numpy as np

examples/gallery/plot/points.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
Points
33
------
44
5-
The :meth:`pygmt.Figure.plot` method can plot points. We must specify the plot symbol
6-
and size through the ``style`` argument.
5+
The :meth:`pygmt.Figure.plot` method can plot points. The plot symbol and size
6+
is set with the ``style`` parameter.
77
"""
88
import numpy as np
99
import pygmt

examples/gallery/plot/scatter3d.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
In the example below, we show how the
77
`Iris flower dataset <https://en.wikipedia.org/wiki/Iris_flower_data_set>`__
88
can be visualized using a perspective 3-dimensional plot. The ``region``
9-
argument has to include the :math:`x`, :math:`y`, :math:`z` axis limits in the
9+
parameter has to include the :math:`x`, :math:`y`, :math:`z` axis limits in the
1010
form of (xmin, xmax, ymin, ymax, zmin, zmax), which can be done automatically
11-
using :meth:`pygmt.info`. To include the z-axis stick, set ``frame`` as a
11+
using :meth:`pygmt.info`. To plot the z-axis frame, set ``frame`` as a
1212
minimum to something like ``frame=["WsNeZ", "zaf"]``. Use ``perspective`` to
1313
control the azimuth and elevation angle of the view, and ``zscale`` to adjust
1414
the vertical exaggeration factor.

examples/projections/README.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
Projections
22
===========
33

4-
PyGMT support many map projections. Use the ``projection`` argument to specify which one
5-
you want to use in all plotting modules. The projection is specified by a one letter
6-
code along with (sometimes optional) reference longitude and latitude and the width of
7-
the map (for example, **A**\ *lon0/lat0*\ [*/horizon*\ ]\ */width*). The map height is
8-
determined based on the region and projection.
4+
PyGMT support many map projections. Use the ``projection`` parameter to specify which
5+
one you want to use in all plotting modules. The projection is specified by a one
6+
letter code along with (sometimes optional) reference longitude and latitude and the
7+
width of the map (for example, **A**\ *lon0/lat0*\ [*/horizon*\ ]\ */width*). The map
8+
height is determined based on the region and projection.
99

1010
These are all the available projections:

examples/projections/nongeo/cartesian_linear.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
fig = pygmt.Figure()
1010
fig.plot(
11-
# The ``x`` and ``y`` arguments determine the coordinates of lines
11+
# The x and y parameters determine the coordinates of lines
1212
x=[3, 9, 2],
1313
y=[4, 9, 37],
1414
pen="3p,red",

examples/tutorials/3d-perspective-image.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323

2424
########################################################################################
2525
# The :meth:`pygmt.Figure.grdview` method takes the ``grid`` input.
26-
# The ``perspective`` argument changes the azimuth and elevation of the viewpoint; the
26+
# The ``perspective`` parameter changes the azimuth and elevation of the viewpoint; the
2727
# default is [180, 90], which is looking directly down on the figure and north is "up".
28-
# The ``zsize`` argument sets how tall the three-dimensional portion appears.
28+
# The ``zsize`` parameter sets how tall the three-dimensional portion appears.
2929
#
3030
# The default grid surface type is *mesh plot*.
3131

@@ -62,7 +62,7 @@
6262
fig.show()
6363

6464
########################################################################################
65-
# The ``plane`` argument sets the elevation and color of a plane that provides a fill
65+
# The ``plane`` parameter sets the elevation and color of a plane that provides a fill
6666
# below the surface relief.
6767

6868
fig = pygmt.Figure()

examples/tutorials/first-figure.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,13 @@
8181
# ``ps*`` modules had their ``ps`` prefix removed. The exceptions are:
8282
# ``psxy`` which is now ``plot``, ``psxyz`` which is now ``plot3d``, and ``psscale``
8383
# which is now ``colorbar``.
84-
# 2. The arguments don't use the GMT 1-letter syntax (R, J, B, etc). We use longer
85-
# aliases for these arguments and have some Python exclusive names. The mapping
86-
# between the GMT arguments and their Python counterparts should be straight forward.
87-
# 3. Arguments like ``region`` can take lists as well as strings like ``1/2/3/4``.
88-
# 4. If a GMT argument has no options (like ``-B`` instead of ``-Baf``), use a ``True``
89-
# in Python. An empty string would also be acceptable. For repeated arguments, such
84+
# 2. The parameters don't use the GMT 1-letter syntax (**R**, **J**, **B**, etc). We use longer
85+
# aliases for these parameters and have some Python exclusive names. The mapping
86+
# between the GMT parameters and their Python counterparts should be straight
87+
# forward.
88+
# 3. Parameters like ``region`` can take lists as well as strings like ``1/2/3/4``.
89+
# 4. If a GMT parameter has no options (like ``-B`` instead of ``-Baf``), use a ``True``
90+
# in Python. An empty string would also be acceptable. For repeated parameters, such
9091
# as ``-B+Loleron -Bxaf -By+lm``, provide a list: ``frame=["+Loleron", "xaf", "y+lm"]``.
9192
# 5. There is no output redirecting to a PostScript file. The figure is generated in the
9293
# background and will only be shown or saved when you ask for it.

examples/tutorials/frames.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Frames, ticks, titles, and labels
33
=================================
44
5-
Setting the style of the map frames, ticks, etc, is handled by the ``frame`` argument
5+
Setting the style of the map frames, ticks, etc, is handled by the ``frame`` parameter
66
that all plotting methods of :class:`pygmt.Figure`.
77
88
.. note::
@@ -62,7 +62,7 @@
6262
# Title
6363
# -----
6464
#
65-
# The figure title can be set by passing **+t**\ *title* to the ``frame`` argument of
65+
# The figure title can be set by passing **+t**\ *title* to the ``frame`` parameter of
6666
# :meth:`pygmt.Figure.basemap`. Passing multiple arguments to ``frame`` can be done by
6767
# using a list, as show in the example below.
6868

@@ -75,7 +75,7 @@
7575
########################################################################################
7676
# To use a title with multiple words, the title must be placed inside another set of
7777
# quotation marks. To prevent the quotation marks from appearing in the figure title,
78-
# the ``frame`` argument can be passed in single quotation marks and the title can be
78+
# the ``frame`` parameter can be passed in single quotation marks and the title can be
7979
# passed in double quotation marks.
8080

8181
fig = pygmt.Figure()
@@ -89,7 +89,7 @@
8989
# -----------
9090
#
9191
# Axis labels can be set by passing **x+l**\ *label* (or starting with **y** if
92-
# labeling the y-axis) to the ``frame`` argument of :meth:`pygmt.Figure.basemap`.
92+
# labeling the y-axis) to the ``frame`` parameter of :meth:`pygmt.Figure.basemap`.
9393
# By default, all 4 map boundaries (or plot axes) are plotted with both tick marks and
9494
# axis labels. The axes are named as **W** (west/left), **S** (south/bottom),
9595
# **N** (north/top), and **E** (east/right) sides of a figure. If an upper-case axis

examples/tutorials/inset.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@
4141
########################################################################################
4242
#
4343
# The :meth:`pygmt.Figure.inset` method uses a context manager, and is called using a
44-
# ``with`` statement. The ``position`` argument, including the inset width, is required
45-
# to plot the inset. Using the **j** argument, the location of the inset is
44+
# ``with`` statement. The ``position`` parameter, including the inset width, is
45+
# required to plot the inset. Using the **j** argument, the location of the inset is
4646
# set to one of the 9 anchors (bottom-middle-top and left-center-right). In the
47-
# example below, ``BL`` sets the inset to the bottom left. The ``box`` argument can
47+
# example below, ``BL`` sets the inset to the bottom left. The ``box`` parameter can
4848
# set the fill and border of the inset. In the example below, ``+pblack`` sets the
4949
# border color to black and ``+gred`` sets the fill to red.
5050

examples/tutorials/lines.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
# Plot lines
2222
# ----------
2323
#
24-
# Create a Cartesian figure using ``projection`` argument and set the axis scales
24+
# Create a Cartesian figure using ``projection`` parameter and set the axis scales
2525
# using ``region`` (in this case, each axis is 0-10). Pass a list of ``x`` and ``y``
2626
# values to be plotted as a line.
2727

@@ -72,7 +72,7 @@
7272
# Change line attributes
7373
# ----------------------
7474
#
75-
# The line attributes can be set by the ``pen`` argument. ``pen`` takes a string
75+
# The line attributes can be set by the ``pen`` parameter. ``pen`` takes a string
7676
# argument with the optional values *width*,\ *color*,\ *style*.
7777
#
7878
# In the example below, the pen width is set to ``5p``, and with ``black`` as the
@@ -90,7 +90,7 @@
9090
fig.show()
9191

9292
########################################################################################
93-
# The line color can be set and is added after the line width to the ``pen`` argument.
93+
# The line color can be set and is added after the line width to the ``pen`` parameter.
9494
# In the example below, the line color is set to ``red``.
9595

9696
fig = pygmt.Figure()
@@ -106,7 +106,7 @@
106106

107107
########################################################################################
108108
# The line style can be set and is added after the line width or color to the
109-
# ``pen`` argument. In the example below, the line style is set to
109+
# ``pen`` parameter. In the example below, the line style is set to
110110
# ``..-`` (*dot dot dash*), and the default color ``black`` is used.
111111

112112
fig = pygmt.Figure()
@@ -121,7 +121,7 @@
121121
fig.show()
122122

123123
########################################################################################
124-
# The line width, color, and style can all be set in the same ``pen`` argument. In the
124+
# The line width, color, and style can all be set in the same ``pen`` parameter. In the
125125
# example below, the line width is set to ``7p``, the color is set to ``green``, and the
126126
# line style is ``-.-`` (*dash dot dash*).
127127
#

examples/tutorials/plot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@
5252

5353
########################################################################################
5454
# We used the style ``c0.3c`` which means "circles of 0.3 centimeter size". The ``pen``
55-
# argument controls the outline of the symbols and the ``color`` controls the fill.
55+
# parameter controls the outline of the symbols and the ``color`` controls the fill.
5656
#
5757
# We can map the size of the circles to the earthquake magnitude by passing an array to
58-
# the ``sizes`` argument. Because the magnitude is on a logarithmic scale, it helps to
58+
# the ``sizes`` parameter. Because the magnitude is on a logarithmic scale, it helps to
5959
# show the differences by scaling the values using a power law.
6060

6161
fig = pygmt.Figure()

examples/tutorials/regions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Set the region
33
==============
44
5-
Many of the plotting functions take the ``region`` argument, which sets
5+
Many of the plotting functions take the ``region`` parameter, which sets
66
the area that will be shown in the figure. This tutorial covers the different types of
77
inputs that it can accept.
88

0 commit comments

Comments
 (0)