How do I stop figures from stealing focus without having to create a global variable?
10 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I'm running nonlinear FE analysis and adding load/displacement points for every iteration using animated line. The function that does the plotting right now does not have access to the figure handle, but I do know the figure number, so I end up having to use figure(1). The problem is figure() will by default make the image pop, which prevents me from doing anything on the computer while the code is running. I've seen some answers to similar questions saying that this should be used:
set(0,'CurrentFigure',figHandle);
But right now, unless I make the figure handle global or pass it to every function until it gets to where I need it to be I can't use this structure. Is there a work around this? Maybe using tags on the figures?
0 Commenti
Risposte (1)
Steven Lord
il 4 Feb 2019
Are you're sharing the handle to the graphics object that you're updating among the functions that update it? If so, ask that object what its ancestor figure is. Assuming h is the handle to the graphics object, f is its ancestor figure.
f = ancestor(h, 'figure')
But I'm curious -- why do you need to do anything with the figure handle?
2 Commenti
Jess
il 11 Gen 2021
I have a similar question. I can't speak for why the OP needs the figure handle, but I send the figure handle to a routine that beautifies and saves the figure in a specified format.
Vedere anche
Categorie
Scopri di più su Graphics Object Programming in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!