Skip to content

Commit 4483e01

Browse files
committed
Merge branch 'main' into optional-dependencies
2 parents 0880d07 + 817b28a commit 4483e01

File tree

5 files changed

+51
-35
lines changed

5 files changed

+51
-35
lines changed

examples/gallery/symbols/custom_symbols.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
fig = pygmt.Figure()
1616
fig.basemap(region=[0, 8, 0, 3], projection="X12c/4c", frame=True)
1717

18-
# define pen and fontstlye for annotations
18+
# define pen and fontstyle for annotations
1919
pen = "1p,black"
2020
font = "15p,Helvetica-Bold"
2121

examples/get-started/first_figure.py

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
55
This tutorial page covers the basics of creating a figure using PyGMT - a
66
Python wrapper for the Generic Mapping Tools (GMT). It will only use
7-
the ``coast`` method for plotting. Later examples will address other PyGMT
8-
methods.
7+
the :meth:`pygmt.Figure.coast` method for plotting. Later examples will
8+
address other PyGMT methods.
99
"""
1010

1111
###############################################################################
@@ -21,8 +21,8 @@
2121
# Loading the library
2222
# -------------------
2323
#
24-
# The first step is to import ``pygmt``. All methods and figure generation is
25-
# accessible from the :mod:`pygmt` top level package.
24+
# The first step is to import :mod:`pygmt`. All methods and figure generation
25+
# are accessible from the :mod:`pygmt` top level package.
2626

2727
# sphinx_gallery_thumbnail_number = 4
2828
import pygmt
@@ -38,10 +38,11 @@
3838

3939
###############################################################################
4040
# To add to a plot object (``fig`` in this example), the PyGMT module is used
41-
# as a method on the class. This example will use the ``coast`` method, which
42-
# can be used to create a map without any other methods, modules or external
43-
# data. The ``coast`` method plots the coastlines, borders, and bodies of water
44-
# using a database that is included in GMT.
41+
# as a method on the class. This example will use the
42+
# :meth:`pygmt.Figure.coast` method, which can be used to create a map without
43+
# any other methods, modules or external data. The :meth:`pygmt.Figure.coast`
44+
# method plots the coastlines, borders, and bodies of water using a database
45+
# that is included in GMT.
4546
#
4647
# First, a region for the figure must be selected. This example will plot some
4748
# of the coast of Maine in the northeastern US. A Python list can be passed to
@@ -51,11 +52,12 @@
5152
# right) coordinates are (N44.75, W68). Negative values can be passed for
5253
# latitudes in the southern hemisphere or longitudes in the western hemisphere.
5354
#
54-
# In addition to the region, an argument needs to be passed to ``coast`` to
55-
# tell it what to plot. In this example, ``coast`` will be told to plot the
56-
# shorelines by passing the Boolean value ``True`` to the ``shorelines``
57-
# parameter. The ``shorelines`` parameter has other options for finer control,
58-
# but setting it to ``True`` uses the default values.
55+
# In addition to the region, an argument needs to be passed to
56+
# :meth:`pygmt.Figure.coast` to tell it what to plot. In this example,
57+
# :meth:`pygmt.Figure.coast` will be told to plot the shorelines by passing the
58+
# Boolean value ``True`` to the ``shorelines`` parameter. The ``shorelines``
59+
# parameter has other options for finer control, but setting it to ``True``
60+
# uses the default values.
5961

6062
fig.coast(region=[-69, -68, 43.75, 44.75], shorelines=True)
6163

@@ -74,9 +76,9 @@
7476
#
7577
# When plotting colors in PyGMT, there are multiple
7678
# :gmt-docs:`color codes <gmtcolors.html>`, that can be used. This includes
77-
# standard GMT color names (like ``skyblue``), R/G/B levels (like ``0/0/255``),
78-
# a hex value (like ``#333333``), or a graylevel (like ``50``). For this
79-
# example, GMT color names are used.
79+
# standard GMT color names (like ``"skyblue"``), R/G/B levels (like
80+
# ``"0/0/255"``), a hex value (like ``"#333333"``), or a gray level (like
81+
# ``"gray50"``). For this example, GMT color names are used.
8082

8183
fig = pygmt.Figure()
8284
fig.coast(
@@ -102,7 +104,7 @@
102104
# projections are explained in the :doc:`projection </projections/index>`
103105
# gallery. For this example, the Mercator projection is set using ``"M"``.
104106
# The width of the figure will be 10 centimeters, as set by ``"10c"``.
105-
# The map size can also be set in inches using "i" (e.g. a 5 inch wide
107+
# The map size can also be set in inches using "i" (e.g. a 5-inch wide
106108
# Mercator projection would use ``"M5i"``).
107109

108110
fig = pygmt.Figure()

examples/projections/cyl/cyl_universal_transverse_mercator.py

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,33 @@
22
Universal Transverse Mercator
33
=============================
44
5-
A particular subset of the transverse Mercator is the Universal Transverse
6-
Mercator (UTM) which was adopted by the US Army for large-scale military maps.
7-
Here, the globe is divided into 60 zones between 84°S and 84°N, most of which
8-
are 6° (in longitude) wide. Each of these UTM zones have their unique central
9-
meridian. Furthermore, each zone is divided into latitude bands but these are
10-
not needed to specify the projection for most cases.
5+
A particular subset of the
6+
:doc:`transverse Merctor </projections/cyl/cyl_transverse_mercator>`
7+
is the Universal Transverse Mercator (UTM) which was adopted by the US Army
8+
for large-scale military maps. Here, the globe is divided into 60 zones
9+
between 84°S and 84°N, most of which are 6° (in longitude) wide.
10+
Each of these UTM zones have their unique central meridian.
11+
Furthermore, each zone is divided into latitude bands but these are
12+
not needed to specify the projection for most cases. See Figure
13+
:ref:`Universal Transverse Mercator <GMT_utm_zones>` for all zone designations.
14+
15+
.. _GMT_utm_zones:
16+
17+
.. figure:: https://docs.generic-mapping-tools.org/latest/_images/GMT_utm_zones.png # noqa: W505
18+
:width: 700 px
19+
:align: center
20+
21+
Universal Transverse Mercator zone layout.
1122
1223
In order to minimize the distortion in any given zone, a scale factor of 0.9996
13-
has been factored into the formulae. This makes the UTM projection a secant
14-
projection and not a tangent projection like the transverse Mercator above. The
15-
scale only varies by 1 part in 1,000 from true scale at equator. The
16-
ellipsoidal projection expressions are accurate for map areas that extend less
17-
than 10° away from the central meridian.
24+
has been factored into the formulae (although a standard, you can change this
25+
with :gmt-term:`PROJ_SCALE_FACTOR`). This makes the UTM projection a *secant*
26+
projection and not a *tangent* projection like the
27+
:doc:`transverse Merctor </projections/cyl/cyl_transverse_mercator>`.
28+
The scale only varies by 1 part in 1,000 from true scale at equator. The
29+
ellipsoidal projection expressions are accurate for map areas that extend
30+
less than 10° away from the central meridian. For larger regions we use the
31+
conformal latitude in the general spherical formulae instead.
1832
1933
**u**\ *zone/scale* or **U**\ *zone/width*
2034

examples/tutorials/advanced/contour_map.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
# Contour line settings
3232
# ---------------------
3333
#
34-
# Use the ``annotation`` and ``interval`` arguments to adjust contour line
34+
# Use the ``annotation`` and ``interval`` parameters to adjust contour line
3535
# intervals. In the example below, there are contour intervals every 250 meters
3636
# and annotated contour lines every 1,000 meters.
3737

@@ -47,8 +47,8 @@
4747
# Contour limits
4848
# --------------
4949
#
50-
# The ``limit`` argument sets the minimum and maximum values for the contour
51-
# lines. The argument takes the low and high values, and is either a list (as
50+
# The ``limit`` parameter sets the minimum and maximum values for the contour
51+
# lines. The parameter takes the low and high values, and is either a list (as
5252
# below) or a string ``limit="-4000/-2000"``.
5353

5454
fig = pygmt.Figure()
@@ -64,7 +64,7 @@
6464
# Map settings
6565
# ------------
6666
#
67-
# The :meth:`pygmt.Figure.grdcontour` method accepts additional arguments,
67+
# The :meth:`pygmt.Figure.grdcontour` method accepts additional parameters,
6868
# including setting the projection and frame.
6969

7070
fig = pygmt.Figure()
@@ -85,7 +85,7 @@
8585
# The :meth:`pygmt.Figure.grdimage` method can be used to add a
8686
# colormap to the contour map. It must be called prior to
8787
# :meth:`pygmt.Figure.grdcontour` to keep the contour lines visible on the
88-
# final map. If the ``projection`` argument is specified in the
88+
# final map. If the ``projection`` parameter is specified in the
8989
# :meth:`pygmt.Figure.grdimage` method, it does not need to be repeated in the
9090
# :meth:`pygmt.Figure.grdcontour` method.
9191

examples/tutorials/basics/lines.py

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

4545
###############################################################################
4646
# To plot multiple lines, :meth:`pygmt.Figure.plot` needs to be used for each
47-
# additional line. Arguments such as ``region``, ``projection``, and ``frame``
47+
# additional line. Parameters such as ``region``, ``projection``, and ``frame``
4848
# do not need to be repeated in subsequent uses.
4949

5050
fig = pygmt.Figure()

0 commit comments

Comments
 (0)