Hi Everyone,
I would like to ask how I can resize the velocity arrows in PyGMT. In the GMT version, I believe there is a way to resize the velocity arrows based on their values, so that smaller values have smaller arrows and larger values have larger arrows. I would like to apply the same approach in PyGMT, but I haven’t been able to find how to do it. Could you help with this?
Hi @muhammetnergizci,
Hm. It is a bit difficult to help here in detail, as we only have an image. Maybe you can provide the code you already have (even if it is not perfect or correctly working) and point out what exactly the issue is that you are facing.
In general, plotting vectors can be achived using Figure.plot
, please see this PyGMT tutorial Plotting vectors — PyGMT.
Maybe you are refering to GMT’s psvelo
or velo
? This is also available in PyGMT as the method Figure.velo
with a gallery example at Velocity arrows and confidence ellipses — PyGMT.
Hi Yvonne! Thanks for answering the question, Yes I am using figure.velo in PyGMT to plot velocities like:
fig.velo(
data=df,
spec=“e0.5/0.95+f2”, # Velocity ellipses in (N, E) convention
pen=“0.5p,purple”, # Outline pen for the arrows and ellipses
line=True, # Draw ellipses with a pen
vector=“0.15c+p0.3p+e+gpurple”,
)
However, I haven’t found the flag to resize the arrows according to their values. What I mean is that smaller values, like 0.05, should look like a dot, while larger values, like 3, should appear bigger.
Hi, I have found the flag to resizing the arrow regarding their values just you need to add +n in the vector section!
# gnsss velos
fig.velo(
data=df_gnss,
spec="e0.75/0.39/18", # Velocity ellipses in (N, E) convention
pen="0.75p,purple", # Outline pen for the arrows and ellipses
line=True, # Draw ellipses with a pen
vector="0.4c+ea+gpurple+n0.5", # Larger arrowheads for large displacements
)