How to put an axes into the foreground layer in GUI (made by GUIDE)?
Afficher commentaires plus anciens
I have a GUI with several axes defined. When running the program I would like to select an axes and enlarge or move it inside the figure window. I can do it with the selection tool. However the layer position of individual axes depend on the order defined in the GUIDE, when I was designing the figure window. I cannot change it when the program is running. So the axes is enlarged behind another axes, and therefore they are not visible properly.
How to put axes into foreground when I am running the program?
Réponses (2)
Walter Roberson
le 10 Mai 2018
0 votes
uistack() works on axes.
13 commentaires
Walter Roberson
le 15 Mai 2018
Those modes are not compatible. plot edit needs control over all of the clicks.
You could use axes or figure button down fcn callbacks to select the axes, but at the moment no good method for interactively resizing an axes is coming to mind.
Csaba
le 15 Mai 2018
Walter Roberson
le 15 Mai 2018
It is quite unlikely that this will ever be implemented in GUIDE. GUIDE is only being maintained if changes to MATLAB make its internal code incompatible. All of the effort is being placed in App Designer. GUIDE will be retired when App Designer has been expanded for all of the major functionality that GUIDE has now.
Csaba
le 16 Mai 2018
Csaba
le 16 Mai 2018
@Csaba: You are right. I've removed my comment to avoid confusing readers.
If all you want to do is to resize/move the axes, what about using a context menu to start this? I'm not sure, if the function from the plotedit tools can be reused directly, but you can search where it is triggered by using the profiler: profile on, then select the axes and resize it, profile report. Maybe it is not possible to call this tool directly. But you could write your own resize function for an axes object. The older function selectmoveresize was useful, but now plotedit is recommended, although this is an indirection.
Walter Roberson
le 16 Mai 2018
"I do not see what GUIDE has to do in this case"
You used GUIDE in your title, and you specifically referred to layering order created by GUIDE.
plotedit was designed for HG1, and ignores figures created by the new App Designer.
Walter Roberson
le 16 Mai 2018
The problem is not solved in App Designer because plotedit cannot be used with App Designer.
The efforts for graphics tools are being directed to App Designer.
The limitation has to do with the fact that the plot editor UI Mode Manager takes over callbacks, including axes button down functions, temporarily disabling whatever button down function you might have programmed. This is because there is no separate callback for left-mouse and right-mouse, so the plot editor cannot put in a right-mouse editor menu without affecting use of left-mouse. And besides, axes button down fcn are defined to fire on all mouse buttons, with it being up to the user to define behavior for specific buttons if they want to.
I posted a work-around for HG1 for R2014a and before. Yair posted an update for HG2 in his http://undocumented-matlab.com . I do not happen to recall limitations after Yair's hacks.
Csaba
le 16 Mai 2018
Walter Roberson
le 16 Mai 2018
I do not know at the moment if you can resize objects in App Designer. The question at hand is whether you can use plotedit with App Designer, as you are locked into using plotedit in your workflow.
Csaba
le 16 Mai 2018
Catégories
En savoir plus sur Develop Apps Using App Designer dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!