MATLAB Answers

Data cursor on GUI plot

3 views (last 30 days)
Alex
Alex on 20 Nov 2013
Edited: Reza Sadeghi on 25 Feb 2020
Hi, I have a GUI with a table and a plot as you can see: </matlabcentral/answers/uploaded_files/4822/guisanstitre.png>
I woudl like to put a Data cursor on my plot to get the value of points.
I try to do :
hPlot=plot(handles.axes1,courbe);figure(gcf) % display my plot
dcm_obj = datacursormode(hPlot);
datacursormode on;
set(dcm_obj,'UpdateFcn', @myupdatefcn )
but matlab return an error:
Error using datacursormode (line 144)
Invalid figure handle
Could you help me, maybe there is a better way to get a data cursor?
Thank you

  0 Comments

Sign in to comment.

Answers (2)

Alex
Alex on 22 Nov 2013
Nobody can help me :(

  0 Comments

Sign in to comment.


Sébastien MAILFERT
Sébastien MAILFERT on 25 Sep 2018
Same problem, 5 years later :-(

  1 Comment

Reza Sadeghi
Reza Sadeghi on 25 Feb 2020
I think the following line may help you
[x,y] = ginput(1)

Sign in to comment.