The VECTOR function draws a plot of either vectors or wind barbs. The vectors or wind barbs are input using two arrays that specify the horizontal and vertical components (in arbitrary units). You can also specify the X and Y locations for the vectors or wind barbs.

Tip: The LEGEND function may be used to add a "sample" vector of a given length to a vector plot.

Tip: The purpose of the VECTOR function is to draw a vector field or wind field at a series of (X, Y) locations. The units of the vector or wind field are arbitrary, and are not related to the units for the X and Y coordinates. The ARROW function (with the DATA keyword) may be used to draw arrows that are directly related to the X and Y coordinates.

## Example

The following lines create the graphic shown at the right.

n = 21
x = 10*DINDGEN(n)/(n-1) - 5
y = 10*DINDGEN(n)/(n-1) - 5
xx = REBIN(x, n, n)
yy = REBIN(TRANSPOSE(y), n, n)
mu = 1
xdot = mu*(xx - xx^3/3 - yy)
ydot = xx/mu

v = VECTOR(xdot, ydot, x, y, $ AUTO_COLOR=1, AUTO_RANGE=[0,45],$
RGB_TABLE=10, $ POSITION=[0.10,0.22,0.95,0.9],$
XTITLE='X', YTITLE='Y', $ TITLE='Van der Pol Oscillator - Phase Portrait')   ; Change some properties. v.ARROW_THICK = 2 v.LENGTH_SCALE = 2   ; Add a colorbar and text annotations. c = COLORBAR(TARGET=v,$

### TRANSPARENCY

An integer between 0 and 100 that specifies the percent transparency of the graphic. The default value is 0.

### USE_DEFAULT_COLOR

Set this property to use the color of the vectors for the missing-point symbols (this is the default). If this property is explicitly set to 0, the color specified by the SYM_COLOR property is used for symbols.

### UVALUE

Set this property to an IDL variable of any data type.

### VECTOR_COLORS

Set this property to a vector or two-dimensional array with the same number of elements as U, or a two-dimensional array containing RGB triplets (or RGBA) representing colors to be used for each vector. If this property is set to an array with the same number of elements as U, these values are indices into a color table that can be specified by the RGB_TABLE property. If the RGB_TABLE property is not set, a grayscale color is used. For RGB triplets the first dimension of VECTOR_COLORS must be 3 (or 4 for RGBA), and the second dimension must be equal to the number of elements in U. If this property is omitted, the vectors are drawn in the color specified by the COLOR property or the default color.

If VECTOR_COLORS is not of type byte, it is byte scaled into the range 0-255. This is useful if you have an auxiliary dataset (say of type float) and you want to color your vectors according to this auxiliary dataset.

Tip: IDL will remember the original data range of VECTOR_COLORS before byte scaling. If you insert a colorbar for the vector visualization, the colorbar axis will have the correct range for your auxiliary dataset.

### VECTOR_STYLE

Set this property to specify the style of the vector visualization. Possible values are:

• 0 or "Arrows" - Vectors are drawn as arrows with lines for arrowheads.
• 1 or "Barbs" - Vectors are drawn as wind barbs with feathers and flags.

### WINDOW (Get Only)

This property retrieves a reference to the WINDOW object which contains the graphic.

### WINDOW_TITLE

Set this property to the title of the IDL Graphic window. The title is displayed in the window's title bar.

### X_SUBSAMPLE

Set this property to an integer giving a subsampling factor to be used for the first dimension of U and V. If U and V are one-dimensional arrays then this property value is used for the subsampling factor for the arrays. This property is ignored if AUTO_SUBSAMPLE is true.

### Y_SUBSAMPLE

Set this property to an integer giving a subsampling factor to be used for the second dimension of U and V. If U and V are one-dimensional arrays then this property is ignored and only the X_SUBSAMPLE is used. This property is ignored if AUTO_SUBSAMPLE is true.

### XRANGE

A two-element vector giving the X data range to vector. The default behavior is to vector the entire data range.

### YRANGE

A two-element vector giving the Y data range to vector. The default behavior is to vector the entire data range.

### ZVALUE

A scalar value to be used as the z-coordinate for the entire vector. By default, 0.0 is used as the z-coordinate.

## Version History

 8.0 Introduced 8.1 Added the following properties: CROSSHAIR, MAPPROJECTION, MAP_PROJECTION, MAPGRID, UVALUE, WINDOW, [XYZ]SHOWTEXT, [XYZ]STYLE The THICK property was changed to accept a value between 0 and 10. Added the following methods: Delete, GetData, GetValueAtLocation, MapForward, MapInverse, SetData 8.2 Added AXES, BACKGROUND_COLOR, BACKGROUND_TRANSPARENCY, CLIP properties. 8.2.1 Added ANTIALIAS property. [XYZ]TICKUNITS accepts exponent as a value. 8.2.2 Change POSITION from a keyword to a property. 8.6 Changed default font name and font size. 8.9 Allow subsampling to work if U and V are one-dimensional (an irregular grid).