grdvector(1) GMT grdvector(1)

## NAME

grdvector - Plot vector field from two component grids

## SYNOPSIS

grdvectorcompx.nccompy.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.

## DESCRIPTION

grdvectorreads two 2-D grid files which represents thex- andy-compo- nents 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 coordinater,thetagrids may be given instead.

## REQUIRED ARGUMENTS

compx.ncContains the x-components of the vector field.compy.ncContains the y-components of the vector field. (See GRID FILE FORMATS below.)-Jparameters(morea|) Select map projection.

## OPTIONAL ARGUMENTS

-AThe grid files contain polar (r, theta) components instead of Cartesian (x, y) [Default is Cartesian components].-B[p|s]parameters(morea|) Set map boundary frame and axes attributes.-C[cpt] Usecptto assign colors based on vector length. Alternatively, supply the name of a GMT color master dynamic CPT [rainbow] to automatically determine a continuous CPT from the gridas z-range. If the dynamic CPT has a default range then that range will be imposed instead. Yet another option is to specify -Ccolor1,color2[,color3,a|] to build a linear continuous cpt from those colors automatically. In this casecolorncan be a r/g/b triplet, a color name, or an HTML hexadecimal color (e.g. #aabbcc ).-GfillSets color or shade for vector interiors [Default is no fill].-I[x]dx[/dy] Only plot vectors at nodes everyx_inc,y_incapart (must be multiples of original grid spacing). Appendmfor arc minutes orsfor arc seconds. Alternatively, use-Ixto specify the multi- plesmultx[/multy] directly [Default plots every node].-K(morea|) Do not finalize the PostScript plot.-NDo NOT clip vectors at map boundaries [Default will clip].-O(morea|) Append to existing PostScript plot.-P(morea|) SelectaPortraitaplot orientation.-QparametersModify vector parameters. For vector heads, append vector headsize[Default is 0, i.e., stick-plot]. See VECTOR ATTRIBUTES for specifying additional attributes.-Rxmin/xmax/ymin/ymax[+r][+uunit] (morea|) Specify the region of interest. Specify a subset of the grid.-S[i|l]scaleSets scale for Cartesian vector length in data units per dis- tance measurement unit [1]. Appendc,i, orpto indicate the measurement unit (cm, inch,or point). Prependlto indicate a fixed length for all vectors. For Geographic data, give scale in data units per km. Use-Siif it is simpler to give the reciprocal scale in measurement unit per data unit or km per data unit.-TMeans the azimuths of Cartesian data sets should be adjusted according to the signs of the scales in the x- and y-directions [Leave alone]. This option can be used to convert vector azimuths in cases when a negative scale is used in one of both directions (e.g., positive down).-U[[just]/dx/dy/][c|label] (morea|) Draw GMT time stamp logo on plot.-V[level] (morea|) Select verbosity level [c].-WpenSet pen attributes used for vector outlines [Default: width = default, color = black, style = solid].-X[a|c|f|r][x-shift[u]]-Y[a|c|f|r][y-shift[u]] (morea|) Shift plot origin.-ZThe theta grid provided contains azimuths rather than directions (implies-A).-f[i|o]colinfo(morea|) Specify data types of input and/or output columns.-p[x|y|z]azim[/elev[/zlevel]][+wlon0/lat0[/z0]][+vx0/y0] (morea|) Select perspective view.-t[transp] (morea|) Set PDF transparency level in percent.-^or just-Print a short message about the syntax of the command, then exits (NOTE: on Windows just use-).-+or just+Print an extensive usage (help) message, including the explana- tion of any module-specific option (but not the GMT common options), then exits.-?or no arguments Print a complete usage (help) message, including the explanation of all options, then exits.

## GRID FILE FORMATS

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 calledapackingaof grids, writing out floating point data as 1- or 2-byte integers. (morea|)

## VECTOR ATTRIBUTES

Several modifiers may be appended to the vector-producing options to specify the placement of vector heads, their shapes, and the justifica- tion 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:+aanglesets the angle of the vector head apex [30].+bplaces a vector head at the beginning of the vector path [none]. Optionally, appendtfor a terminal line,cfor a circle,afor arrow [Default],ifor tail,Afor plain arrow, andIfor plain tail. Further appendl|rto only draw the left or right side of this head [both sides].+eplaces a vector head at the end of the vector path [none]. Optionally, appendtfor a terminal line,cfor a circle,afor arrow [Default],ifor tail,Afor plain arrow, andIfor plain tail. Further appendl|rto only draw the left or right side of this head [both sides].+g-|fillturns off vector head fill (if -) or sets the vector head fill [Default fill is used, which may be no fill].+hshapesets the shape of the vector head (range -2/2). Default is controlled by MAP_VECTOR_SHAPE [0].+ldraws half-arrows, using only the left side of specified heads [both sides].+mplaces a vector head at the mid-point the vector path [none]. Appendforrfor forward or reverse direction of the vector [for- ward]. Optionally, appendtfor a terminal line,cfor a circle, orafor arrow head [Default]. Further appendl|rto only draw the left or right side of this head [both sides]. Cannot be combined with+bor+e.+nnormscales down vector attributes (pen thickness, head size) with decreasing length, where vectors shorter thannormwill have their attributes scaled by length/norm[arrow attributes remains invariant to length].+oplon/platspecifies the oblique pole for the great or small cir- cles. Only needed for great circles if+qis given.+p[-][pen] sets the vector pen attributes. Ifpenhas a leading - then the head outline is not drawn. [Default pen is used, and head outline is drawn]+qmeans the inputangle,lengthdata instead represent thestartandstopopening angles of the arc segment relative to the given point.+rdraws half-arrows, using only the right side of specified heads [both sides].+t[b|e]trimwill shift the beginning or end point (or both) along the vector segment by the giventrim; append suitable unit. If the modifiersb|eare not used thentrimmay 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:+jjustdetermines how the inputx,ypoint relates to the vector. Choose frombeginning [default],end, orcenter.+smeans the inputangle,lengthare instead thex,ycoordinates of the vector end point. Finally, Cartesian vectors may take these modifiers:+zscale[unit] expects inputdx,dyvector components and uses thescaleto convert to polar coordinates with length in given unit.

## EXAMPLES

To draw the vector field given by the files r.nc and theta.nc on a lin- ear 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

## SEE ALSO

gmt(1),gmtcolors(5),grdcontour(1),psxy(1)

## COPYRIGHT

2017, P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis, and F. Wobbe 5.4.2 Jun 24, 2017 grdvector(1)

gmt5 5.4.2 - Generated Thu Jun 29 08:31:47 CDT 2017