# STICKVECT is the jGraph module of jLab.

``` STICKVECT Plots "stick vectors" for multicomponent velocity time series.

STICKVECT(TIME,SCALE,U,V), where U and V are measurements of eastward
and northward velocities respectively, represents the velocity points
as vectors strung out along the x-axis.

The vector TIME is used as the x-axis, and SCALE is the stretching
factor used to map U values onto TIME.  SCALE velocity units correspond
to one X unit. The aspect ratio of the plot is set so that angles are
not distorted, i. e. the velocity (U,V)=(1,1) will point northeastward.

SCALE is set as follows. To make X velocity units to correspond to Y
units on the x-axis, we choose SCALE=X/Y.  For example, let's say that
we have time in days, and we want 10 cm/s to correspond to 100 days.
Then SCALE=10/100=0.1.  If we have time in years and we want 10 cm/s to
correspond to 1/10 of a year, we set SCALE=10/(1/10)=100.

In general, to make the vectors appear *larger*, make SCALE *smaller*.
As scale gets larger, the x-axis becomes more stretched out and so the
stick vectors appear smaller.

STICKVECT(TIME,SCALE,U,V,NSTICKS) plots only NSTICKS vectors evenly
spaced throughout the length of the input vectors.

STICKVECT may also be used with multicomponent time series. In this
case U and V are matrices the columns of which are distinct time series
from (for example) different depths.

STICKVECT(TIME,SCALE,U,V,NSTICKS,SHIFT), when U and V are matrices,
will offset the stickvector lines in the vertical by amount SHIFT.
SHIFT may either be a scalar, denoting the offset between adjacent time
series, a vector containing the "baseline" values for each instrument,
or a matrix of same size as U and V.  TIME may be a vector, or it may
be a matrix of the same size as U and V.

STICKVECT(TIME,CV,...), where CV=U+iV, also works.

STICKVECT plots a small diagonal line in the upper right-hand corner of
the plot, which should be at a 45 degree angle; this provides a check
that the aspect ratio is correct.

H=STICKVECT(...) returns a vector containing handles to the stickvector
lines of the various time series.

To adjust the appearance of the plot, first vary SCALE and then vary
NSTICKS.

As an example,

cv=vfilt(bravo94.rcm.cv,100);
stickvect(yearfrac(bravo94.rcm.num),180,cv,300,-30);

recreates the upper part of Fig. 24 of Lilly et. al JPO 1999.
This may be run by typing 'stickvect --f'.

Usage:  stickvect(time,scale,u,v);
stickvect(time,scale,u,v,nsticks);
stickvect(time,scale,u,v,nsticks,shift);
_________________________________________________________________
This is part of JLAB --- type 'help jlab' for more information
(C) 1998--2017 J.M. Lilly --- type 'help jlab_license' for details
```