How can I get DataCursor information from scatter plot using a callback function in app designer

6 Ansichten (letzte 30 Tage)
Hello,
In app designer, I'm trying to implement a functionality where I would click on a data point in a scatter plot and that would trigger the generation of a new plot related specifically to that selected point. Currently I was able to turn the datacrusor mode on and select different data points by clicking on the plot. What I'm trying to achieve now is that when I click on a point I can obtain the information of which point has beeen selected through the data crusor then generate a new figure. I have tried to implement a buttondown call back funtion but I wasnt able to get anywhere with that. Can anyone please assist me with that?
Thank you,
Ahmed,

Antworten (1)

Simon Chan
Simon Chan am 7 Jun. 2023
Bearbeitet: Simon Chan am 7 Jun. 2023
The coordinates is stored in the property called IntersectionPoint belongs to the events in the ButtonDownFcn callback as shown below:
function getPoint(src,event)
hitCoord = event.IntersectionPoint
end
  4 Kommentare
Ahmed
Ahmed am 7 Jun. 2023
Hello again Simon,
Thank you! the example was really helpful. Do you know how to integrate this implementation in the app designer environment in MATLAB? it seems like some function in this example cant be used in app designer.
Simon Chan
Simon Chan am 8 Jun. 2023
Have you try to implement it in App Designer and which part of the example does not used in App Designer?
What are the error messages?
Attached is an example for your reference.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Develop Apps Using App Designer finden Sie in Help Center und File Exchange

Produkte


Version

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by