MATLAB: Is it possible to display a crosshair everytime a point is marked with the data cursor tool in MATLAB R2010b

MATLAB

In many popular plotting tools, clicking on a point in a plot results in a crosshair (2 perpendicular lines at that point). I am looking for a way to do this with the data cursor tool.

Best Answer

When a point on a line is selected with the data cursor tool, a Text Update Function is called in order to get the coordinates of the point and display them. The same function is called when you further click on the line and select other points. To open the corresponding script, right click on the marker and select "Edit Text Update Function".
A custom function can be used as the Text Update callback by right-clicking on the marker and choosing "Select Text Update Function". For instance, the attached script "NewCallback.m" plots a crosshair at the point selected with the data cursor.