function rosekey(xc,yc,ybin,wide,num,xfac,yfac)
%	plots a key for a rose diagram:
%		xc,yc   coordinates of top left-hand corner of key
%		ybin  top limits of speed bins
%		wide  widths of speed bin bars
%		num   number of speed bins to make key for.
x0=xc;
y0=yc;
xc=0.;
yc=0.;
xus=[0 0 1 1 0 0];
yus=[0 -.5 -.5 .5 .5 0];
l=5+num*4;
w=wide(num)+10;
%
mid=yc-wide(num)/2-2;
left=xc;
yt=yc-w+5;
%text(x0+xfac*(left+1),y0+yfac*yt,'0')
for i=1:num
	xt=left+i*4;
	xbox=xus*4+xt-2;
	ybox=yus*wide(i)+mid;
	plot(x0+xfac*xbox,y0+yfac*ybox,'r-')
	if rem(i,2)==0
%		text(x0+xfac*xt,y0+yfac*yt,num2str(ybin(i)))
	end
end
xt=left+num*2;
%text(x0+xfac*xt,y0+yfac*(yt-2),'cm/s')
%text(x0+xfac*xt,y0+yfac*yc,'KEY')
yp=yt-10;
bp=yp-1;
tp=yp+1;
lp=xt-5;
rp=lp+20;
mp=.5*(lp+rp);
xbar=[lp lp lp mp mp mp rp rp rp];
ybar=[tp bp yp yp tp yp yp bp tp];
plot(x0+xfac*xbar,y0+yfac*ybar)
%text(x0+xfac*(lp-1),y0+yfac*(bp-3),'0')
%text(x0+xfac*(rp-2),y0+yfac*(bp-3),'10 %')
