Hi @tiannh7,
These are quite interesting questions!
From reading the GMT docs for velo, I think it’s unfortuantely not possible to plot the extensional and compressional arrows of a strain cross in different colors, but users have to call velo twice, please see the PyGMT code below. Maybe users with more experience know more here
.
import pygmt
import numpy as np
size = 5
# >>> I have littel experience with plotting strain crosses. <<<
# >>> All data / numbers are are rondaom / dummy data. <<<
data = np.array([
[-2, 0, 0.5, -0.2, 70, -1],
[ 0, 0, 0.5, -0.2, 70, 0],
[ 2, 0, 0.5, -0.2, 70, 1],
])
data_ext = data.copy()
data_ext[:,2] = [0] * len(data)
data_com = data.copy()
data_com[:,3] = [0] * len(data)
fig = pygmt.Figure()
fig.basemap(region=[-size, size] * 2, projection=f"X{size * 2}c", frame="g1")
for data, vector, pen in zip(
[data_ext, data_com],
["+a40+h0.2", "+a60+h0"],
["1.5p,black", "2p,gray50,2_2"],
):
fig.velo(data=data, spec="x5c", vector=vector, pen=pen)
fig.show()
Output figure:
Regarding the black outlined white filled arrow (head and stem) in the provided map (for details see velo — GMT 6.6.0 documentation):
Vectors were completely redesigned for GMT5 which separated the vector head (a polygon) from the vector stem (a line). In GMT4, the entire vector was a polygon and it could only be a straight Cartesian vector.
Arrows with different head and tail: I think there are some possibilities, like different symbols for the head and tail, but I think one can not provided different fill colors:
import pygmt
fig = pygmt.Figure()
fig.basemap(region=[-5, 5, -2, 2], projection="X10c/4c", frame=1)
for y, style in zip(
[-1, 1],
["v0.6c+ba+eA+a60+h0", "v0.6c+ba+ec+a60+h0"],
):
fig.plot(
x=-3,
y=y,
style=style,
direction=([0], [6]),
pen="1p",
fill="red",
)
fig.show()
Output figure:
But it’s possible to add symbols at the start and end of lines via -W. There, symbols and colors can be adjusted separately for the start and end; for details see 3. General Features — GMT 6.6.0 documentation.
import pygmt
fig = pygmt.Figure()
fig.basemap(region=[-5, 5, -1, 1], projection="X10c/2c", frame=1)
fig.plot(
x=[-4, 4],
y=[0, 0],
pen="1p,gray50+vb0.6c+bc+gpurple+p1.5p,magenta+ve0.8c+gblue+p1p,cyan",
)
fig.show()
Output figure: