gmtvector can take x,y or x,y,z as input, while grdvector can only take x,y. Why can’t grdvector eat z-components? How does an x,y-vector differ from an x,y,z vector on a plot?
Well, I was thinking about stuff that goes beyond that. I’m not very familiar with vector fields and this stuff, but if I’ve understood correctly, one can draw field lines as well, which is something different that plotting the vector (arrow) itself.
And then there is the flux, which is very new to me. What additional information this would yield, I’m not sure of.
Now I have I doubt. I add the original vectors and I hoped that they will have the same direction than the lines but they don’t. Are the graph ok? How can I get lines that follow the vectors?
Looks to me the lines are wrong. Since there is symmetry across x = 0 all vectors should be horizontal there, but the contours from grdgradient are not. THe vectors are correct (pretty sure). The contours are angles (scalars) while the vectors are, well, vectors.
Gradient or aspect should be the same since the field lines would be identical (just multiplied by -1, I think).
Your solution looks good I think @Esteban82.
Here is an(other) example:
gmt begin grdvector-test png
gmt grdmath -R-15/15/-15/15 -I0.5 X X MUL Y Y MUL ADD = circle.nc
gmt grdimage circle.nc -t50
gmt grdgradient circle.nc -Gtheta.nc -Sr.nc -Dca
gmt makecpt -Crainbow -T0/42/1
gmt grdvector -A r.nc theta.nc -Q0.35c+e -Gblack -Sl2c -I2 -l"gradient descent" -C -W+c
gmt grdcontour -C45 -Wred theta.nc -Z+p -Bxaf -Byaf -B+t"Gradient descent" -l"field lines"
gmt end show
rm circle.nc theta.nc r.nc