function []=stkplot(pltnum, maxnum, x, u, v, n, ltype)
%	Plot stick plot on stack axis.
%
%	function []=stkplot(pltnum, maxnum, x, u, v, [, n, [ltype]])
%	  pltnum= plot number counting bottom up {scaler}
%	  maxnum= total number of plots per page {scaler}
%	  x= x axis (time) {vector}
%	  u= {vector}
%	  v= {vector}
%	  n= plot every nth stick
%	  ltype= line (or symbol) type (optional default='-c5')

%	Latest revision by P. Dragos 21-May-91.
%
%	P. Dragos, Battelle Ocean Sciences
%	Duxbury, MA 02332
%	(617) 934-0571
%
%	Copyright (c) 1991 by Paul Dragos.
%	This program is copyrighted.  However, you are encouraged to
%	copy and share it, so long as no charge is imposed.

%				---------------------------------------
%				defaults from stkparm.mat
load stkparm.mat
x0= stkx0; y0= stky0; x1= stkx1; y1= stky1;
sep= stksep; c= stkc; dc=stkdc; 
ax=stkax(pltnum,:);
%				---------------------------------------
%				defaults
if nargin < 6, n=1; ltype= dc; end;
if nargin == 6,
  if (isstr(n)==0), ltype= dc;  else, ltype=n; n=1; end;
end;
j=[1:n:length(u)];
%				---------------------------------------
%				calculate axis boundaries
yaxl=(((y1-y0)-sep)/maxnum)-sep;
xaxl=x1-x0;
ystr=((pltnum-1)*(yaxl+sep))+sep;
xstr=x0;
%				---------------------------------------
%				Scale the data
vscale= yaxl / (ax(4) - ax(3));
vp= vscale .* v;
uscale= vscale;
up= uscale .* u;

y=zeros(v);
yp= (vscale .* (y - ax(3))) + ystr;

xscale= xaxl / (ax(2) - ax(1));
xp= (xscale .* (x - ax(1))) + xstr;

%				---------------------------------------
%				plot the zero line
xz=[ax(1) ax(2)];
xz= (xscale .* (xz - ax(1))) + xstr;
yz=[0 0];
yz= (vscale .* (yz - ax(3))) + ystr;
plot(xz,yz,c);

%				---------------------------------------
%				plot data
xplot=ones(length(xp(:)),2);
yplot=xplot;
xplot(:,1)=xp(:);
xplot(:,2)=xp(:)+up(:);
yplot(:,1)=yp(:);
yplot(:,2)=yp(:)+vp(:);

plot(xplot(j,:)',yplot(j,:)',ltype);

return;
