You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that barb -Q+z (use U, V instead of speed, azimuth) is 180° rotated.
(the workaround is to compute the azimuth manually and just use the default mode)
It seems that barb -Q+z (use U, V instead of speed, azimuth) is 180° rotated.
Hmm, not sure if I understand your issue correctly and my knowledge from my Bachelor times is a bit older. But as far as I know, in meteorology the direction reported as wind direction is the direction FROM which the wind is blowing. Thus, the barbs are drawn in the way that the "lines" or "triangles" are on the side from which the wind is blowing. From your webpage I get you are a geophysicist and oceanographer. If I remember it correctly, in oceanography we used the direction IN which something is flowing. Maybe this different conventions cause a confusion here?
Just playing a bit more with this barb module. And I am currently confused about the (u,v) wind components.
From the GMT docs I get u should be in the third and v in the fourth columns.:
+z - Input (u,v) wind components instead of (azimuth,speed).
But my resulting plot looks like this:
As far as I know u is the component positiv to east (x direction) and v the component positiv to north (y direction). So looking at my plot, u and v are flipped, and the third column is plotted as v and the fourth column is plotted as u.
Dear @yvonnefroehlich, @joa-quim
Thank you for informing me of the issue and sorry for my delayed response.
As yvonnefroehlich mentioned, u and v seem flipped.
d=d_atan2d (in[ex2+S.read_size], in[ex1+S.read_size]); /* Compute direction */
for vector plots, but it is for the direction (counterclockwise from east) not for the azimuth (clockwise from north). I think it should be fixed as follows:
--- a/src/windbarbs/psbarb.c+++ b/src/windbarbs/psbarb.c@@ -543,3 +543,3 @@ EXTERN_MSC int GMT_psbarb (void *V_API, int mode, void *args) {
if (Ctrl->Q.B.status & PSL_VEC_COMPONENTS) /* Read dx, dy in user units */
- d = d_atan2d (in[ex2+2*S.read_size], in[ex1+2*S.read_size]);+ d = d_atan2d (-in[ex1+2*S.read_size], -in[ex2+2*S.read_size]);
else
Activity
gd-a commentedon Apr 17, 2026
It's the same without +z by the way... so it's consistent
Could it be because of the +e / +b / +c modifier?
yvonnefroehlich commentedon Apr 17, 2026
Hmm, not sure if I understand your issue correctly and my knowledge from my Bachelor times is a bit older. But as far as I know, in meteorology the direction reported as wind direction is the direction FROM which the wind is blowing. Thus, the barbs are drawn in the way that the "lines" or "triangles" are on the side from which the wind is blowing. From your webpage I get you are a geophysicist and oceanographer. If I remember it correctly, in oceanography we used the direction IN which something is flowing. Maybe this different conventions cause a confusion here?
I think no. If I understand the docs correctly, +jb|c|e](https://docs.generic-mapping-tools.org/dev/supplements/windbarbs/barb.html#q) can be used to adjust the part (beginning, center, end) of the barb which is used to place the barb on the map related to the given x and y coordinates.
Data and code used for the plots (sorry it's PyGMT with GMT):
yvonnefroehlich commentedon Apr 17, 2026
Just playing a bit more with this
barbmodule. And I am currently confused about the(u,v)wind components.From the GMT docs I get
ushould be in the third andvin the fourth columns.:But my resulting plot looks like this:

As far as I know
uis the component positiv to east (x direction) andvthe component positiv to north (y direction). So looking at my plot,uandvare flipped, and the third column is plotted asvand the fourth column is plotted asu.Related data and code:
joa-quim commentedon Apr 20, 2026
Dear @masahigaki
I would like to call your attention to this discussion and ask if you could help enlightening these raised doubts.
Best regards
masahigaki commentedon Apr 26, 2026
Dear @yvonnefroehlich, @joa-quim
Thank you for informing me of the issue and sorry for my delayed response.
As yvonnefroehlich mentioned,
uandvseem flipped.In psbarb.c, the azimuth is computed as
gmt/src/windbarbs/psbarb.c
Line 544 in ce1f5a1
gmt/src/psxy.c
Line 2203 in ce1f5a1
joa-quim commentedon Apr 27, 2026
Dear @masahigaki
Thanks you for looking into this and proposing a fix. @yvonnefroehlich want to do the PR?