I plot my data and I need to show data (Y) in text box when I put the mouse cursor on it (without click), is there any fuction that help me?
No products are associated with this question.
Here is a simple example that outlines how to do it using HITTEST.
function getcoords(varargin) this = hittest; if strcmp(get(this,'type'),'line'); cp = get(gca,'currentpoint'); ht = title(num2str(cp([1 3]))); set(ht,'color',get(this,'color')); end
datacursormode() with a custom callback function that sends the coordinate to the edit box as well as displaying it on the screen.
You can use the WindowsButtonMotion function of the parent figure. There OVEROBJ can check, if the mouse is over the specified axes and the CurrentPoint property of this axes contains the coordinates. Now you need a method to find the nearest (interpolated?) point of your data for the display.