function varargout = draw(varargin)

persistent h

if  ~isempty(varargin) 
   varargout = {h};
   return
end

a = round( get(gca, 'CurrentPoint') );

if isempty(h)
	h = plot(a(1,1),a(1,2),'r','EraseMode','none');
	drawnow
else

	xdata = get(h,'XData');	ydata = get(h,'YData');

	lastpoint = [ xdata(length(xdata)) ; ydata(length(xdata))];
	
	if ( a(1,1) == lastpoint(1)  & a(1,2)==lastpoint(2) )
	else
		xdata = [ xdata, a(1,1)]; ydata = [ ydata, a(1,2)];
		set (h,'XData',xdata,'YData',ydata)

	end


end


