
        function arrows (x,y,u,v,isolid,vscale,itail,colour)
%
%------------------------------------------------------------------------
%
%	Draws vector arrows on maps.
%
%------------------------------------------------------------------------
%
%   Usage :
%           arrows (x,y,u,v,isolid,vscale,itail,colour)
%
%   Input :
%	    Matrices of equal shape:-
%		x        = x positions for arrows.
%		y        = y positions for arrows.
%		u        = x components of arrows.
%		v        = y components of arrows.
%	        isolid   = 0 for a hollow arrow, 1 for a solid one.
%
%	        vscale   = arrow scale in vector_units/cm.
%	        itail    = 0, arrows centred on (x,y),
%		         = 1, arrow tails on (x,y).
%		colour	 = single char. specifying colour e.g. 'r'.
%
%------------------------------------------------------------------
%

	global pxrange pyrange
%
%...... Reshape matrices.
%	   
	[m,n] = size(x) ;
	x = reshape(x,1,m*n) ;
	y = reshape(y,1,m*n) ;
	u = reshape(u,1,m*n) ;
	v = reshape(v,1,m*n) ;
%
%...... Calculate an approx. map scale in metres/cm (paper copy only).
%
	posa = trupos(pxrange,pyrange) ;
	ppos  = get(gcf,'PaperPosition') ;
	mapscale = pxrange/(posa(3)*ppos(3)) ;
%
%...... Convert vector components from vector units to plot units (metres).
%
	xlen = u * mapscale / vscale ; 
	ylen = v * mapscale / vscale ;
%
%...... Calc. arrow coords.
%
	if (~itail),
            xdisp = 0.5 * xlen ;
            ydisp = 0.5 * ylen ;
            xshaft(1:2,:) = [x-xdisp ; x+.26*xdisp] ;
            yshaft(1:2,:) = [y-ydisp ; y+.26*ydisp] ;
	else
            xdisp = xlen ;
            ydisp = ylen ;
            xshaft(1:2,:) = [x;x+.63*xdisp] ;
            yshaft(1:2,:) = [y;y+.63*ydisp] ;
	end
%
	xhead(1,:) =  x + xdisp ;
        yhead(1,:) =  y + ydisp ;
%
        xhead(2,:) = xhead(1,:) - 0.12 * ylen - 0.36 * xlen ;
        yhead(2,:) = yhead(1,:) + 0.12 * xlen - 0.36 * ylen ;
%
        xhead(3,:) = xhead(2,:) + 0.24 * ylen ;
        yhead(3,:) = yhead(2,:) - 0.24 * xlen ;
%
        xhead(4,:) = xhead(1,:) ;
        yhead(4,:) = yhead(1,:) ;
%
%...... Draw arrows for all those arrows deemed 'visible'.
%
        arrlen2cm = (xlen.*xlen + ylen.*ylen)/(mapscale^2) ;
	ind = find(arrlen2cm > 0.0001) ;
	lwidth = max(2*sqrt(arrlen2cm(ind)),0.5) ;
	nplot = length(ind) ;
	for i = 1:nplot,
	    indi = ind(i) ;
	    hs = plot (xshaft(:,indi),yshaft(:,indi),['-' colour]) ;
	    set(hs,'Linewidth',lwidth(i)) ;
	    if (isolid(indi)),
	        hf = patch (xhead(:,indi),yhead(:,indi),colour) ;
	        set(hf,'Edgecolor',colour) ;
	    else
		hh = plot(xhead(:,indi),yhead(:,indi),['-' colour]) ;
	        set(hh,'Linewidth',lwidth(i)) ;
	    end
	end


