Data cursor on GUI plot

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

Respuestas (2)

Alex
Alex el 22 de Nov. de 2013

0 votos

Nobody can help me :(
Sébastien MAILFERT
Sébastien MAILFERT el 25 de Sept. de 2018

0 votos

Same problem, 5 years later :-(

1 comentario

Reza Sadeghi
Reza Sadeghi el 25 de Feb. de 2020
Editada: Reza Sadeghi el 25 de Feb. de 2020
I think the following line may help you
[x,y] = ginput(1)

Iniciar sesión para comentar.

Categorías

Más información sobre Creating, Deleting, and Querying Graphics Objects en Centro de ayuda y File Exchange.

Preguntada:

el 20 de Nov. de 2013

Editada:

el 25 de Feb. de 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by