% Scans data points from an image file % A=imread(input('Image file ','s')); colormap('colorcube') image(A) % fprintf('Click on the lower left, and then upper right corners of the plot\n'); [x,y]=ginput(2); % xvlo=input('X value at lower left corner '); yvlo=input('Y value at lower left corner '); xvhi=input('X value at upper right corner '); yvhi=input('Y value at upper right corner '); % ax=(xvhi-xvlo)/(x(2)-x(1)); bx=xvlo-ax*x(1); ay=(yvhi-yvlo)/(y(2)-y(1)); by=yvlo-ay*y(1); % fprintf('Now click on a point whose value you know\n'); test=ginput(1); tx=ax*test(1)+bx; ty=ay*test(2)+by; fprintf('The coordinates of the point are (X,Y)=(%g,%g)\n',tx,ty); % fprintf('Now click on the data points. when you are done.\n') [x,y]=ginput; xdata=ax*x+bx; ydata=ay*y+by; plot(xdata,ydata,'o')