GRDVECTOR(1gmt) | GMT | GRDVECTOR(1gmt) |
grdvector - Plot vector field from two component grids
grdvector compx.nc compy.nc -Jparameters [ -A ] [ -B[p|s]parameters ] [ -Ccpt ] [ -Gfill ] [ -I[x]dx[/dy] ] [ -K ] [ -N ] [ -O ] [ -P ] [ -Qparameters ] [ -Rregion ] [ -S[i|l]scale ] [ -T ] [ -U[stamp] ] [ -Wpen ] [ -Xx_offset ] [ -Yy_offset ] [ -Z ] [ -fflags ] [ -pflags ] [ -ttransp ]
Note: No space is allowed between the option flag and the associated arguments.
grdvector reads two 2-D grid files which represents the x- and y-components of a vector field and produces a vector field plot by drawing vectors with orientation and length according to the information in the files. Alternatively, polar coordinate r, theta grids may be given instead.
-X[a|c|f|r][x-shift[u]]
By default GMT writes out grid as single precision floats in a COARDS-complaint netCDF file format. However, GMT is able to produce grid files in many other commonly used grid file formats and also facilitates so called "packing" of grids, writing out floating point data as 1- or 2-byte integers. (more ...)
Several modifiers may be appended to the vector-producing options to specify the placement of vector heads, their shapes, and the justification of the vector. Below, left and right refers to the side of the vector line when viewed from the start point to the end point of the segment:
+b places a vector head at the beginning of the vector path [none]. Optionally, append t for a terminal line, c for a circle, a for arrow [Default], i for tail, A for plain arrow, and I for plain tail. Further append l|r to only draw the left or right side of this head [both sides].
+e places a vector head at the end of the vector path [none]. Optionally, append t for a terminal line, c for a circle, a for arrow [Default], i for tail, A for plain arrow, and I for plain tail. Further append l|r to only draw the left or right side of this head [both sides].
+g-|fill turns off vector head fill (if -) or sets the vector head fill [Default fill is used, which may be no fill].
+hshape sets the shape of the vector head (range -2/2). Default is controlled by MAP_VECTOR_SHAPE [0].
+l draws half-arrows, using only the left side of specified heads [both sides].
+m places a vector head at the mid-point the vector path [none]. Append f or r for forward or reverse direction of the vector [forward]. Optionally, append t for a terminal line, c for a circle, or a for arrow head [Default]. Further append l|r to only draw the left or right side of this head [both sides]. Cannot be combined with +b or +e.
+nnorm scales down vector attributes (pen thickness, head size) with decreasing length, where vectors shorter than norm will have their attributes scaled by length/norm [arrow attributes remains invariant to length].
+oplon/plat specifies the oblique pole for the great or small circles. Only needed for great circles if +q is given.
+p[-][pen] sets the vector pen attributes. If pen has a leading - then the head outline is not drawn. [Default pen is used, and head outline is drawn]
+q means the input angle, length data instead represent the start and stop opening angles of the arc segment relative to the given point.
+r draws half-arrows, using only the right side of specified heads [both sides].
+t[b|e]trim will shift the beginning or end point (or both) along the vector segment by the given trim; append suitable unit. If the modifiers b|e are not used then trim may be two values separated by a slash, which is used to specify different trims for the two ends. Positive trims will shorted the vector while negative trims will lengthen it [no trim].
In addition, all but circular vectors may take these modifiers:
+s means the input angle, length are instead the x, y coordinates of the vector end point.
Finally, Cartesian vectors may take these modifiers:
To draw the vector field given by the files r.nc and theta.nc on a linear plot with scale 5 cm per data unit, using vector rather than stick plot, scale vector magnitudes so that 10 units equal 1 inch, and center vectors on the node locations, run
gmt grdvector r.nc theta.nc -Jx5c -A -Q0.1i+e+jc -S10i > gradient.ps
To plot a geographic data sets given the files com_x.nc and comp_y.nc, using a scale of 200 km per data unit and only plot every 3rd node in either direction, try
gmt grdvector comp_x.nc comp_y.nc -Ix3 -JH0/20c -Q0.1i+e+jc -S200 > globe.ps
gmt, gmtcolors, grdcontour, psxy
2019, P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis, and F. Wobbe
May 21, 2019 | 5.4.5 |