function hh=feather(x,y,s)
%FEATHER Feather plot.
%   FEATHER(U,V) plots the velocity vectors with components U and V as
%   arrows emanating from equally spaced points along a horizontal axis.
%   FEATHER is useful for displaying direction and magnitude data that
%   is collected along a path.
%
%   FEATHER(Z) for complex Z is the same as FEATHER(REAL(Z),IMAG(Z)).
%   FEATHER(...,'LineSpec') uses the color and linestyle specification
%   from 'LineSpec' (see PLOT for possibilities).
%
%   H = FEATHER(...) returns a vector of line handles.
%
%   Example:
%      theta = (-90:10:90)*pi/180; r = 2*ones(size(theta));
%      [u,v] = pol2cart(theta,r);
%      feather(u,v), axis equal
%
%   See also COMPASS, ROSE, QUIVER.

%   Charles R. Denham, MathWorks 3-20-89
%   Modified 1-2-92, ls.
%   Modified 12-7-93 Mark W. Reichelt
%   Copyright (c) 1984-98 by The MathWorks, Inc.
%   $Revision: 5.9 $  $Date: 1997/11/21 23:46:17 $

if isstr(x)
    error('First argument must be numeric.');
end
xx = [0 1 .8 1 .8]';
yy = [0 0 .08 0 -.08].';
arrow = xx + yy.*sqrt(-1);

if nargin == 2
   if isstr(y)
      s = y;
      y = imag(x); x = real(x);
   else
      s = '-';
   end
elseif nargin == 1
   s = '-';
   y = imag(x); x = real(x);
end
if isstr(x) | isstr(y)
    error('First 1 or 2 numeric arguments must be numeric.')
end
[st,co,mark,msg] = colstyle(s); error(msg)

x = x(:);
y = y(:);
if length(x) ~= length(y)
   error('X and Y must be the same length.');
end
[m,n] = size(x);

z = (x + y.*sqrt(-1)).';
a = arrow * z + ones(5,1)*(1:m);

% Plot the feather
h = plot(real(a), imag(a), [st co mark], [1 m], [0 0], [st co mark]);
if isempty(co),
  co = get(gca,'colororder');
  set(h,'color',co(1,:))
end
if nargout>0, hh = h; end
