In principle, for color-coding symbols the desired quantity has to be in the thirth column of the input data.
For vectors, please note, that the synthax has changed between GMT 4 and GMT 5 (plot — GMT 6.6.0 documentation). For the new vector definition, the stem is no longer considered as polygon (see also parts of How to draw double-headed arrows with hollow and solid heads in pygmt?). However, the GMT 4 synthax is still supported, and users can do something like this:
# %%
import pygmt
# Set up example data for plotting arrows
# x, y, quantity which should be used for the color-coding, direction, length
data = data=[
[-3, 0, -3, 45, 0.2],
[-1, 0, -1, 15, 0.5],
[1, 0, 1, 70, 0.8],
[3, 0, 3, -30, 1],
]
fig = pygmt.Figure()
fig.basemap(region=[-5, 5, -1, 1], projection="X10c/2c", frame="a1g1")
pygmt.makecpt(cmap="batlow", series=[-4, 4])
fig.plot(
data=data,
# GMT4 synthax tailwidth/headlength/halfheadwidth
style="vt0.06c/0.15c/0.1c",
pen="0.01p",
cmap=True,
)
fig.colorbar(frame=True)
fig.show()
For color-coding appliled to pen (to fill), please see the example Line colors with a custom CPT — PyGMT.