How do I stop figures from stealing focus without having to create a global variable?
10 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
Steven Lord
el 4 de Feb. de 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 comentarios
Jess
el 11 de En. de 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.
Ver también
Categorías
Más información sobre Graphics Object Programming en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!