### Ref Sec39.

/I/J/K/L/M/N /X/Y/Z/T/E/F /D /ASPECT /FRAME /LENGTH /NOAXIS /NOLABELS /OVERLAY /PEN /SET_UP /TITLE /COLOR /THICK/TRANSPOSE /HLIMITS /VLIMITS /XSKIP /YSKIP /MODULO /KEY /NOKEY /FLOWLINE /DENSITY /HGRATICULE /VGRATICULE /GRATICULE /OPACITY

Produces a vector arrow plot.

**VECTOR[/qualifiers] x_expr,y_expr **

In a curvilinear coordinate system (map projections)

**VECTOR[/qualifiers] x_expr, y_expr, xcoords, ycoords **(See the chapter on Customizing plots for the 4-argument Vector command)

**Parameters**** **

x_expr, y_expr

Algebraic expressions (or simple variables) specifying the x components and y components of the vector arrows. The expression pair will be inferred from the current context if omitted from the command line.

**Note 1:** An alternative method is to plot a vector field with filled polygons drawn in the shape of the vectors. In addition to representing the vectors' length and direction, the vectors may optionally be colored according to another quantity, i.e. wind vectors colored according to the atmospheric pressure. The scripts poly_vectors.jnl and mp_poly_vectors.jnl, included with Ferret beginning with v5.53, set up to make such plots. poly_arrow_key.jnl draws a arrow key. Please run the script poly_vec_demo.jnl for a demonstration of this capability. See the on-line version of this demo for example figures. Additionally see the color_vector_demo script which uses a method that draws vectors as usual but redefines the pen colors used to match a color scale.

**Note 2:** A second alternative is the plot_vectors.jnl script, which draws the vector arrows from u, v, lon, and lat, where these are 1-dimensional or 2-dimensional variables representing the vector components and the curvilinear coordinates.

**Note 3:** Stick plots, showing vectors along a line in time, may be drawn with the PPL PLOTUV command as in this example from Chapter 6. In addition, the scripts stick_vectors.jnl, and stack_stick.jnl plot customize stick-vector plots.

**Command qualifiers for VECTOR:**** **

VECTOR**/I=/J=/K=/L=/M=/N=/X=/Y=/Z=/T=/E=/F=**

Specifies value or range of axis subscripts (I, J, K, L, M, or N), or axis coordinates (X, Y, Z, T, E, or F) to be used when evaluating the expression being plotted.

VECTOR**/D=**

Specifies the default data set to be used when evaluating the expression pair being plotted.

VECTOR**/ASPECT**

Adjusts the direction of the vectors to compensate for differing axis scaling.

yes? VECTOR/ASPECT[=aspect_ratio] x_expr, y_expr...

*The size of vectors is unchanged; only the direction is modified*. Under most circumstances /ASPECT should be specified. The aspect ratio is (Y-scale/X-scale). If the plot lies in the latitude/longitude plane the aspect ratio correction will be adjusted as a function of COS(LATITUDE) on the plot.

For example, in a typical oceanographic XZ plane plot the vertical (Z) axis is in tens of meters while the horizontal (X) axis is in hundreds of kilometers. This means the vertical scale is greatly magnified in comparison to the horizontal. The /ASPECT qualifier correspondingly magnifies the vertical component of the vector relative to the horizontal while preserving the length of the vector. The magnification factor is documented on the plot with a label, "Adjustment for differing X/Y scales: vv".

If no aspect ratio is specified by the user (e.g. VECTOR/ASP with no value), then Ferret will plot the vectors so that the two components' relative sizes shows their ratio. (In an XZ plane, then, ocean velocity vectors will nearly always appear horizontal) .

If the vector components are offset (staggered grids) then Ferret will plot them; a label is added saying "X and Y components are offset".

VECTOR/FLOWLINE (alias FLOWLINE) draws continuous flowlines from the vector components U and V. The qualifier /DENSITY controls the number of lines drawn. The values of /DENSITY are positive integers. /XSKIP and /YSKIP are not valid when the /FLOWLINE qualifier is used. There is also a 4-argument form of this command for drawing flowlines in curvilinear coordinates. **Note that Ferret does not compute a stream function, but draws a pathline integration of a 2-dimensional instantaneous flow field. In a 3-dimensional flow field the plots are only useful as a qualitative visualization tool.**

The size of the arrows indicates the speed of the flow. Lines are drawn until they intersect a border of the region or another line.

As with the standard VECTOR command, the** /ASPEC**T qualifier adjusts the direction of the vectors to compensate for differing axis scaling. Under most circumstances /ASPECT should be specified.

The underlying algorithm is used with permission from the GrADS program. Our thanks to COLA, the Center for Ocean-Land-Atmosphere Studies, for access to this technique.

**Example 1: **

yes? USE coads_climatology yes? SET REGION/x=150e:130w/y=40s:50n/l=6 yes? FLOW/ASPECT/DENSITY=4 uwnd,vwnd

**Example 2: **

yes? USE coads_climatology yes? SET REGION/x=0:360/y=70s:70n/l=1 yes? go mp_lambert_cyl yes? set grid uwnd yes? go mp_aspect yes? FLOW/ASPECT/NOAXIS/NOLAB uwnd, vwnd, x_page, y_page yes? go mp_fland; go mp_graticule

VECTOR**/FRAME**

Causes the graphic image produced to be captured as an animation frame in the file specified by SET MOVIE. In general the FRAME command is more flexible and we recommend its use rather than this qualifier. (note that HDF movies are discontinued with Ferret V6.6).

VECTOR**/LENGTH=**

Controls the size of vectors.

yes? VECTOR/LENGTH[=value_of_standard]

If the /LENGTH qualifier is omitted Ferret automatically selects reasonable vector lengths. To reuse the vector length from the last VECTOR plot use VECTOR/LENGTH.

To specify the vector lengths manually use the value_of_standard argument. This associates the value "val" with the standard vector length, normally 0.5 inch. Note that the **PPLUS VECSET** command can be used to modify the length of the standard vector. This is also the length that is displayed in the vector key.

When a vector plot is drawn Ferret automatically sets the symbol PPL$VECLEN containing the length.

**Example: **

yes? VECTOR/LENGTH=100 U,V

Creates a vector arrow plot of velocities with 0.5 inch vectors for speeds of 100.

For curvilinear (4-argument) vector plots only. Beginning with Ferret v6.84 the /MODULO qualifier for VECTOR plots will draw modulo replications in longitude for curvilinear data in order to fill out the specified extent in the longitude direction. For instance, if the x-coordinate variable contains longitudes in the range -270:90 we can draw a plot with longitudes 0:360 as follows:

yes? VECTOR/HLIMITS=0:360/MODULO uvec, vvec, xcoords, ycoords

VECTOR/**NOAXIS**

Suppresses all axis lines, tics, and labeling so that no box appears surrounding the contour plot. This is especially useful for map projection plots.

VECTOR**/NOLABELS**

Suppresses all plot labels.

VECTOR**/NOKEY**

Suppresses key at the bottom of the plot which shows the vector length. Use in conjunction with **/NOLABELS** to remove the name of the variables on overlay plots..** **

VECTOR**/KEY**

Forces the vector key to be drawn even if /NOLABELS is set. The location of the key may be changed with the **PPLUS VECKEY** command.

VECTOR**/OVERLAY**

Causes the indicated vector field to be overlaid on the existing plot.

VECTOR**/COLOR=**

Specifies the line color for the vectors. The available color names are Black, Red, Green, Blue, LightBlue, Purple, and White (not case sensitive), corresponding to the /PEN values 1-6, respectively. (/COLOR also accepts numerical values.). Note that White is only available for the default THICKNESS=1.

yes? VECTOR/COLOR=green x_expr, y_expr

**/THICKNESS=**

Sets a thickness value for the vectors, with a value of 1, 2, or 3. /COLOR=RED/THICK=2 is equivalent to p/PEN=8 when using the older /PEN= syntax.

**/COLOR=**

In PyFerret, the value for the /COLOR= may be specified as a color name or number, as in classic Ferret; or may be of the form (R,G,B) or (R,G,B,A). The values of R, G, B, and A range from zero to 100 and are the percent of red, green, blue, and opacity (alpha channel) for the color. If only R, G, and B are given, an opacity of 100 (opaque) is used.

If only R, G, and B are given, an opacity of 100 (opaque) is used.

yes? VECTOR/COLOR=40,100,55) uwnd,vwnd

**/THICKNESS=**

In PyFerret, the value given to /THICKNESS may be any positive real number.

**/OPACITY=**

In PyFerret, the /OPACITY qualifier can be used to specify the opacity (alpha channel value) of the colors used in the plot.The opacity given by this option will be used even if a color definition includes an opacity.** ***This may also be set as a fourth argument to the /COLOR qualifier: VECTOR/COLOR=(RGBA).*

VECTOR**/PEN=**

Specifies the line style for the vectors. /PEN= takes the same arguments as the /LINE= qualifier for command PLOT. See the command PLOT/LINE=. "n" ranges from 1 to 18. Alternately, use the /COLOR= and /THICKNESS= qualifiers to control the style.

yes? VECTOR/PEN=n x_expr, y_expr

VECTOR**/SET_UP**

Performs all the internal preparations required by program Ferret for vector plots but does not actually render output. The command PPL can then be used to make changes to the plot prior to producing output with the PPL VECTOR command. This permits plot customizations that are not possible with Ferret command qualifiers. See the chapter "Customizing Plots".

Note that when the /SETUP qualifier is used the /XSKIP and /YSKIP qualifiers are ignored. In this case, use arguments to the PPL VECTOR command to achieve the thinning.

Also note that when using SET_UP on a vector overlay command, the /OVERLAY qualifier on VECTOR/SET_UP/OVERLAY is essential so that any settings made for aspect ratio etc, on the original underlying plot, will extend to the overlay vectors as well*.*

vector/aspect/vlimits=0:100:10/z=0:40/set u_var, w_var ppl vecset 4,2 ppl vector,4,2 ! Here use VECTOR/OVER_SET_UP and close with PPL VECTOR/OVER. vector/over/set_up/aspect/z=40:90/color=blue u_var,v_var ppl vecset,4,1 ppl vector/over,4,1

**PPL VECTOR/qualifiers,xskip,yskip **

yes? USE coads_climatology yes? VECTOR/SET uwnd,vwnd yes? PPL axset,1,1,0,0 yes? PPL VECTOR,3,4 ! specifies XSKIP=3 and YSKIP=4 yes? ! If it were an overlay plot, that would be PPL VECTOR/OVER,3,4

VECTOR**/TITLE=**

Allows user to specify a plot title (enclosed in quotation marks). Without this qualifier Ferret selects a title based on information about x_expr and y_expr.

yes? VECTOR/TITLE="title_string" x_expr, y_expr

VECTOR**/TRANSPOSE**

Causes the horizontal and vertical axes to be interchanged. By default the X axis is always drawn horizontal and the Y and Z axes are drawn vertical. For Y-Z plots the Z data axis is vertical.

VECTOR**/HLIMITS=**

Specifies horizontal axis limits and tic interval. Without this qualifier, Ferret selects reasonable values.

yes? VECTOR/HLIMITS=lo:hi:increment x_expr, y_expr

The optional "increment" parameter determines tic mark spacing on the axis. If the increment is negative, the axis will be reversed.

This qualifier does not have any impact on the context of the expression being plotted. If data is on a modulo x axis but the arguments of the /HLIMITS qualifier represent a region outside the actual coordinates of the data, only the range including the actual coordinates is shown. Use /X=lo:hi or SET REGION or a context on the variable itself, var[X=lo:hi], to set the context for the expression.

The /HLIMITS and /VLIMITS qualifiers will retain their "horizontal" and "vertical" interpretations in the presence of the /TRANSPOSE qualifier. Thus, the addition of /TRANSPOSE to a plotting command mandates the interchange of "H" and "V" on the limits qualifiers

Specifies the axis range and tic interval for the vertical axis. See /HLIMITS (above)

VECTOR**/XLIMITS=/YLIMITS=****Note**: XLIMITS and YLIMITS have been deprecated. Please use HLIMITS and VLIMITS instead.

VECTOR/**XSKIP=/YSKIP=**

Draws every nth vector along the requested axis beginning with the first vector requested.

yes? VECTOR/XSKIP=nx/YSKIP=ny u,v

By default, Ferret "thins" vectors to achieve a clear plot. These qualifiers allow control over thinning. When a VECTOR plot is drawn, Ferret automatically sets the symbols PPL$VEC_XSKIP and PPL$VEC_YSKIP.

Note that when the /SETUP qualifier is used the /XSKIP and /YSKIP qualifiers are ignored. In this case, use arguments to the PPL VECTOR command to achieve the thinning.

**PPL VECTOR/qualifiers,xskip,yskip **

yes? PPL VECTOR/over/3,4 specifies XSKIP=3 and YSKIP=4

VECTOR/**AXES[=top,bottom,left,right]**

Turns plotting of individual axes off and on. This replaces the use of the "PPL AXSET" command. The syntax is

yes? VECTOR/AXES[=top,bottom,left,right] u,v

where the arguments are 1 to turn the axis on and 0 to turn it off. For example:

yes? VECTOR/AXES=0,1,1,0 u,v ! Draws the bottom and left axes only

VECTOR/GRATICULE[=line specifiers]

(Introduced in Ferret version 5.6) Turns on graticule lines for the horizontal and vertical axes. These are lines across the plot at the tic marks. /GRATICULE sets both horizontal and vertical lines; to set each separately see /HGRATICULE and /VGRATICULE, below. The syntax is

yes? VECTOR/GRATICULE[=line or dash,COLOR=,THICKNESS=] u,v

where the default is a thin, solid black line. The line colors available are Black, Red, Green, Blue, LightBlue, Purple, and White. The thickness codes are 1, 2, or 3 and as for plot lines, thickness=1 is a thin line, thickness=3 is the thickest, and THICK specified with no value defaults to thickness=2. For clarity the arguments to GRAT may be placed in parentheses

yes? VECTOR/GRAT u,v ! default graticules yes? VECTOR/GRAT=(LINE,COLOR=red,THIICK=3) u,v yes? VECTOR/GRAT=(DASH,COLOR=lightblue) u,v yes? VECTOR/FILL/GRAT=(DASH,COLOR=white) u,v

The above commands make settings for the large tic marks. If small tic marks are being plotted on the axes, we can make settings for them as well using keywords SMALL and LARGE. Place all of the arguments for the /GRAT qualifier in double quotes. Note that the PPL AXNMTC command sets the plotting of small tics, and that small tics are used by default for many time axes.

yes? ppl axnmtc 2,2 yes? VECTOR/GRAT="LARGE(COLOR=blue,thick),SMALL(COLOR=lightblue)" u,v

VECTOR/HGRATICULE[=line specifiers]/VGRATICULE[=line specifiers]

Turns on graticule lines and sets the line characteristics of the graticule for the horizontal or vertical axis separately. You may specify only one of /HGRAT or /VGRAT if desired. These are lines across the plot at the tic marks. The syntax is

yes? VECTOR/HGRATICULE[=line or dash,COLOR=,THICKNESS=] /VGRATICULE=line or dash,COLOR=,THICKNESS=] u,v

where the default is a thin, solid black line. The line colors available are Black, Red, Green, Blue, LightBlue, Purple, and White. The thickness codes are 1, 2, or 3 and as for plot lines, thickness=1 is a thin line, thickness=3 is the thickest, and THICK specified with no value defaults to thickness=2. For clarity the arguments to HGRAT may be placed in parentheses

yes? VECTOR/HGRAT/VGRAT u,v !this is equivalent to VECTOR/GRAT yes? VECTOR/HGRAT=(LINE,COLOR=red,THIICK=3)/VGRAT=(color=green) u,v yes? VECTOR/HGRAT=(DASH,COLOR=lightblue) u,v ! horizontal only

The above commands make settings for the large tic marks. If small tic marks are being plotted on the axes, we can make settings for them as well using keywords SMALL and LARGE. Place all of the arguments for the /HGRAT qualifier in double quotes. Note that the PPL AXNMTC command sets the plotting of small tics, and that small tics are used by default for many time axes.

yes? ppl axnmtc 2,2 yes? VECTOR/HGRAT="LARGE(COLOR=blue,thick),SMALL(COLOR=lightblue)" /VGRAT="LARGE(COLOR=blue,thick) u,v