Skip to content

Commit c6f84df

Browse files
Figure.meca: Add an inline example (#4929)
Co-authored-by: Yvonne Fröhlich <94163266+yvonnefroehlich@users.noreply.github.com>
1 parent 4a511a9 commit c6f84df

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

‎pygmt/src/meca.py‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
from pygmt.params import Axis, Frame, Pattern
2121
from pygmt.src._common import _FocalMechanismConvention
2222

23+
__doctest_skip__ = ["meca"]
24+
2325

2426
def _get_focal_convention(spec, convention, component) -> _FocalMechanismConvention:
2527
"""
@@ -347,6 +349,23 @@ def meca(
347349
$panel
348350
$perspective
349351
$transparency
352+
353+
Examples
354+
--------
355+
Plot a single focal mechanism using the Aki and Richards convention:
356+
357+
>>> import pygmt
358+
>>> fig = pygmt.Figure()
359+
>>> fig.basemap(region=[-124, -122, 47, 49], projection="M10c", frame=True)
360+
>>> fig.coast(land="gray80", water="lightblue", shorelines="0.5p,gray30")
361+
>>> fig.meca(
362+
... spec={"strike": 330, "dip": 30, "rake": 90, "magnitude": 3},
363+
... scale="1c",
364+
... longitude=-124.3,
365+
... latitude=48.1,
366+
... depth=12.0,
367+
... )
368+
>>> fig.show()
350369
"""
351370
# Determine the focal mechanism convention from the input data or parameters.
352371
_convention = _get_focal_convention(spec, convention, component)

0 commit comments

Comments
 (0)