Ploticus > Scripts >
proc vector

proc vector displays a group of vectors, using the current data set, in the current plot area. proc vector can render arrows, plain lines, error bars (I bars), T bars, or wind barbs. Vector direction can be specified in degrees, radians, or by directly supplying the coordinates of the second point. Vector length or magnitude can be constant for all vectors, or controlled by your data. See also the vector gallery examples.


xfield and yfield must be supplied. Vector direction and magnitude must be specified, either by a) supplying dirfield along with magfield or constantlen; or b) supplying x2field and y2field.

type     arrow | barb | errorbar | tbar

    Controls the type of vector to draw. Default is arrow

xfield     dfield
yfield     dfield

    Data fields holding the X coordinate and Y coordinate of the vector starting point.

dirfield     dfield

    Data field holding a representation of the direction. By default this is degrees, where 0 is at the top, and rotating clockwise, but other options are available, see dirunits, dirrange, zeroat, and clockdir.

constantlen     h

    This attribute may be specified to cause all vectors to be h inches/cm.
    Example: constantlen: 0.6

x2field     dfield
y2field     dfield

    Data fields holding the X coordinate and Y coordinate of the vector ending point. This is an alternative way of specifying the direction and length of the vector, so if these are specified, then dirfield and magfield are not needed.

Data-driven vector length

magfield     dfield
lenfield     dfield

    Data field holding a representation of the magnitude or length of the vector. By default this is in absolute units (inches or cm), but other options are available, see lenunits and lenscale. lenfield is an alias to magfield.

lenunits     absolute | data | x | y

    Allows the contents of lenfield to be either absolute units (the default), or data units.

lenscale     h

    h is a scaling factor; the contents of lenfield will be multiplied by h. Default is 1.0.

Data-driven vector color

colorfield     dfield

    If specified, the color (and any other linedetails ) for the vector will be controlled using the contents of this data field, using the legend-driven technique (the legend serves as a table to map data values to colors, etc).
    Example: vector3

exactcolorfield     dfield

    If specified, the color (and any other linedetails ) for the vector will be controlled using the contents of this data field directly. For example, to control vector color, this data field could hold values like this:

Vector appearance details

linedetails     line details

    Controls the color, width, etc. of the line portion of the vector.

arrowheadlength     h

    Controls the length of the arrowhead, in inches/cm. Default is 0.15.

arrowheadwidth     h

    Controls the fatness of the arrowhead. Default is 0.4.

arrowheadcolor     color

    Controls the color of the arrowhead. By default this will be the same as the line.

taillen     h

    Controls the length of tails when error bars or t bars are being rendered. h is in absolute units (inches or cm).

clip     yes | no

    Default is yes, which causes vectors to be clipped to the plotting area. Use no to allow vectors to range past the plot area limits.

Vector direction details

dirrange     h

    A range for the values in dirfield. For example, if dirrange is given as 100, a value of 50 would be displayed at 180 degrees.
    Example: dirrange: 12

dirunits     degrees | radians

    Default is degrees. If radians is specified, dirfield is taken to be radians.
    Example: dirunits: radians

zeroat     top | right | bottom | right

    Controls where a zero degree vector will point. Default is top.

clockdir     + | -

    Controls whether progressively higher directional values will cause the vector to move clockwise (+) or counterclockwise (-). Default is +.

Selecting data rows

select     select expression

    Select certain records for plotting, based on a conditional expression.
    Example: select: @@4 = B


legendlabel     label

    Set a legend label for this set of vectors. Legend must be displayed later using proc legend. The legend entry will identify the vector by showing a line segment only (no arrowhead). The \\n construct can be used to force a line break when the legend is displayed, or the label can be wordwrapped using proc legend wraplen attribute (2.32+).

Drawing wind barbs

Set type to barb. For best results, use constantlen to set the size of the barb's stem. The original wind barbs code was contributed by Andrew Phillips.

barblimits     big medium small tiny

    Sets the limits for drawing different sized barbs on the stem of a wind barb. The default for the big triangular barb is 50, the medium sized (full length, 1 line) barb is 10, small sized barb (half length) is 5, tiny barbs are just the stem drawn half length is 2. The tiny barbs are not the official way to show very low wind, which normally is to draw a dot instead, which can be done using a scatterplot and a few selects.
    Example: barblimits: 40 12 8 2

barbdir     d

    The angle the barbs are drawn relative to the stem, in degrees. Default is 120.


Ploticus 2.42 ... May 2013 Terms of use /