How can I force a figure to refresh?
81 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Matt Butts
am 18 Jan. 2023
Kommentiert: Matt Butts
am 18 Jan. 2023
I have a figure that I am doing a lot of programtic manipulation to and after all of the code has executed, some of the elements either aren't visible, or the sizes are all wrong. However, if I simply grab the endge of the window and just slightly resize the figure, everything is refreshed and looks normal.
Before someone says "drawnow", I have tried "drawnow" in multiple locations. It seems like I need to flag the figure as dirty and then call "drawnow", but I haven't figured out a way to do that.
2 Kommentare
Askic V
am 18 Jan. 2023
Did you check refreshdata from the documentation?
https://www.mathworks.com/help/matlab/creating_plots/making-graphs-responsive-with-data-linking.html
Akzeptierte Antwort
Image Analyst
am 18 Jan. 2023
drawnow should work. Maybe it's some quirk of your video adapter. Have you tried the same program on someone else's computer? Or maybe on your second monitor, if you have one? We could try it if you upload your data and code.
3 Kommentare
Image Analyst
am 18 Jan. 2023
You should call tech support, because drawnow should immediately repaint/refresh the current figure. Are you sure you didn't switch to a different figure right before you called drawnow.
drawnow has some options, like nocallbacks, so you might experiment with those.
drawnow nocallbacks
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!