Add P-, T-axis to focal mechanism

Hello @nghia1991ad,

Welcome to the GMT forum :slightly_smiling_face: !

It sounds like you need the GMT flags -Fa, -Fe, -Fg, -Ft, -Fg. Unfortunately, there are no aliases for these flags in PyGMT available yet. But as a workaround, it is possible to use the flags directly in PyGMT (without the hyphen -) as parameters.

import pygmt
import numpy as np

size = 5

fig = pygmt.Figure()
fig.basemap(region=[-size, size] * 2, projection=f"X{size * 2}c", frame=0)

fig.meca(
    spec=np.array([0, 0, 0,  35, 42, 70, 5]),  # lon, lat, dep,  strike, dip, rake, magnitude
    scale="4c+m",
    convention="aki",
    Fa="0.5c/cd",  # Compute and plot P and T axes with symbols, Adjust size and symbols
    Fe="pink",  # Adjust fill of T axis symbol
    Fg="cyan",  # Adjust fill of P axis symbol
    Ft="2p,red",  # Adjust outline of T axis symbol
    Fp="2p,blue",  # Adjust outline of P axis symbol
)

fig.show()

1 Like