function [x,y]=draw2(n);
%function [x,y]=draw2([n]);
%            This is the same as draw.m, but for use without mouse
%            if no n given, stops drawing when you hit escape.

if nargin==0
           n=2000;
end			  
i=1;
[x,y,ibutton]=ginput(1);
hold on
while (i<n)&(ibutton~=27)
   i=i+1;
   [x(i),y(i),ibutton]=ginput(1);
   if ibutton~=27
         plot(x( (i-1):i),y((i-1):i),'c6');
   else 
         x(i)=[]; y(i)=[];
   end
end
hold off


