How to obtain coordinate using 'ginput' in the UIaxis when coding in Appdesigner

When assigning the item in the Appdesigner, for example,
[x,y]=ginput(app.UIaxis,2);
it reminds the extra parameters. So how to obtain the coor of the plot using mouse interaction in the uiaxis? Any suggestion?

 Risposta accettata

Walter Roberson
Walter Roberson il 7 Ago 2022
Modificato: dpb il 7 Ago 2022

4 Commenti

On 4 Oct 2020 @Adam Danz wrote --
"We still don't have an option to specify the target figure handle in ginput..."
and it's now August, 2022, and there still isn't the option and nowhere I can find in the doc that even mentions UIAxes in conjunction with ginput other than old version release notes; nothing made it into the doc itself.
UIAxes aren't the problem in this case. What's blocking ginput from accessing the uiaxes in AppDesigner is that HandleVisibility of the uifigure is set to off so when ginput calls gca, it cannot land on the app axes. But I hear ya.....
Aren't there still issues w/o an addressable target to ginput when there are multiple axes, UIAxes or not, when want/need to programmatically set with which the user is to interact?
There's a long discussion in the thread linked to in which it appears valid use cases are presented -- I didn't take the time to study those in excruciating detail so may have come to wrong conclusion, but seems like the target to address can still be an issue, visible or not.
Now that you're on board, I'm sure all these nits will be fixed sometime next week!!! :)
Yes, these issues with gca are also explained in the tips section of the gca doc page.

Accedi per commentare.

Più risposte (0)

Prodotti

Release

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by