function plotpath(xy,p) % function plotpath(xy,p) % xy are the xy data points % p is the path. load usborder cla; plot(x,y,'c'); axis off; axis([-0.1 1.5 -0.2 1.2]); hold on; drawnow; newxy=xy(p,:); % newxy=[newxy; newxy(1,:)]; xdata=newxy(:,1); ydata=newxy(:,2); plot(xdata,ydata,'r.','Markersize',20); plothandle=plot(xdata,ydata,'y','EraseMode','xor'); axis off; drawnow;