CROSSHAIR: A gui interface for reading (x,y) values from a plot. [Xpoint,Ypoint,XYhist] = crosshair(action); A set of mouse driven crosshairs is placed on the current axes, and displays the current (x,y) values of the line plot. There is an option to provide data specific values or interpolated values. The resolution of the data specific values depends on both the data resolution and the GUI interface (mainly mouse movement resolution). The interpolated values appear to provide a more continuous function, however they too depend on the GUI interface resolution. There are no options for extrapolation. For multiple traces, plots with the same length(xdata) are tracked. Each mouse click returns Xpoint,Ypoint values and selecting 'done' will remove the GUI and restore the mouse buttons to previous values. Selecting 'exit' will remove the GUI and close the figure. In this version (Dec 2002), there are new options to define functions of X/Y and monitor their results. There is also a new STORE button that creates and updates an XYhist struct in the base workspace, which contains value labels and values. This version has better controls of X/Y movements, including better interpolation movement options. This version attempts to respond correctly to keyboard entries also. Some further help is given in the tool tips of the GUI. Note: crosshair always updates the Xpoint,Ypoint in the base workspace. Here is an example of how to get return values within a script/function after pressing the exit button of crosshair: function [X,Y] = crosshair_returnXY x = [1:10]; y(1,:) = sin(x); y(2,:) = cos(x); figure; plot(x,y); crosshair; uiwait X = evalin('base','Xpoint'); Y = evalin('base','Ypoint'); return Copy this text to a function .m file and then call it from the base workspace with [X,Y] = crosshair_returnXY Useage: x = [1:10]; y(1,:) = sin(x); y(2,:) = cos(x); x2 = x.^2; figure; plot(x2,y); crosshair %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%