function [h1, h2]=cl_label(string,fontsize,add_line)
% [h1,  h2] = cl_label(string,fontsize,add_line)
% eg: cl_label('potential temperature',8,0) %click once for label
% eg: cl_label('potential temperature')  %click once for label
%
% click twice for line, and once for label (a little to the right of the line)
% eg: cl_label('potential temperature',8,1) 
%
% details:
% if no argument for add_line or add_line == 0,
%	   click once for the string to land where you click
% fontsize is optional but must be specified if add_line is used
%   default fontsize is 10
% if add_line is used, click at two endpoints for a line connecting 
% 	some portion of the figure to the label: the label is to the 
% 	right of the line
%output
% h1 is the handle to the text
% h2 is the handle to the line, if it exists

h2 = 0;

if (nargin<1)
	help cl_label
	error('must specify label, at least!')
elseif (nargin==1)
	add_line = 0;
	fontsize = 10;
elseif (nargin==2)
	add_line=0;
end

hold on; zoom off ; disp('ZOOM IS OFF; HOLD IS ON')

if (add_line==1)
	disp(['click twice for a line between figure and label " ',string,'"'])
	[x,y]=ginput(2);
	h2 = plot(x,y,'k');
end

disp(['click for location of label:"',string,'"'])
[x,y]=ginput(1);
h1=text(x,y,string);;

set(h1,'FontSize',fontsize);

