Skip to content

Commit cc532f1

Browse files
Improve gallery example "meca.py" (#2199)
1 parent 91bfe28 commit cc532f1

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

examples/gallery/seismology/meca.py

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22
Focal mechanisms
33
----------------
44
5-
The :meth:`pygmt.Figure.meca` method can plot focal mechanisms, or beachballs.
5+
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`` parameter (or they can be specified as a 1d or 2d
8-
array, or within a specified file). The size of plotted beachballs can be
7+
a dictionary using the ``spec`` parameter (or they can be specified as a 1d or
8+
2d array, or within a specified file). The size of plotted beachballs can be
99
specified using the ``scale`` parameter.
1010
"""
1111

1212
import pygmt
1313

1414
fig = pygmt.Figure()
1515

16-
# generate a basemap near Washington state showing coastlines, land, and water
16+
# generate a map near Washington State showing land, water, and shorelines
1717
fig.coast(
1818
region=[-125, -122, 47, 49],
1919
projection="M6c",
@@ -23,11 +23,18 @@
2323
frame="a",
2424
)
2525

26-
# store focal mechanisms parameters in a dict
26+
# store focal mechanism parameters in a dictionary based on the Aki & Richards
27+
# convention
2728
focal_mechanism = dict(strike=330, dip=30, rake=90, magnitude=3)
2829

29-
# pass the focal mechanism data to meca in addition to the scale and event
30-
# location
31-
fig.meca(focal_mechanism, scale="1c", longitude=-124.3, latitude=48.1, depth=12.0)
30+
# pass the focal mechanism data through the spec parameter. In addition provide
31+
# scale, event location, and event depth
32+
fig.meca(
33+
spec=focal_mechanism,
34+
scale="1c", # in centimeters
35+
longitude=-124.3,
36+
latitude=48.1,
37+
depth=12.0,
38+
)
3239

3340
fig.show()

0 commit comments

Comments
 (0)