Plotting vector field


I’m new to gmt and pygmt. I am plotting a vector field on a map with fixed stem and arrow colors.
Is it possible with pygmt to plot a vector field on a map and use a colormap
to color the stem of each vector based on the windspeed ?


Hi @jmbelanger,

It depends on how your vector field is stored as. Is it in a vector/table format, or a grid format?

If it’s a vector/table format, the upcoming PyGMT v0.4.0 release will have a velo function that does this. See the gallery example at and API documentation at

However, you’ll need to install the development version of PyGMT to use it now, i.e. run this in your command-line:

pip install --pre --index-url --extra-index-url pygmt

On the other hand, if your data is in a grid format, have a look at Plot wind vectors from a XArray DataArray for inspiration (using grdvector instead). If you could provide a sample of your data, and/or a figure showing what you want it to look like, we might be able to assist further :smiley: