- perform processing
- set figure
- drawnow
Print in script outputs figures before all lines above it done, and other issues
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Teemu Laurila
am 14 Nov. 2018
Kommentiert: Teemu Laurila
am 16 Nov. 2018
With print, can I force a "wait until catchup" in a script? It seems presently my script is printing deformed figures. They show fine as figures after the script execution is over, and print fine then. But the script that is supposed to output several images occasionally produces crap. Crap has been:
Parts missing from the figure
Priting parts of a wrong figure to a given file
Not getting aspects right (axis versus font sizes)
I generally use set(gcf,'WindowState','maximized') to set a consistent figure size in script, and output with print('-dpng',..)
If it matters, I am working from a network drive location, with two computers running two independent matlabs "homed" to the same folder. (Both computers operate from the same screen, in case that matters for aspects)
0 Kommentare
Akzeptierte Antwort
Nick
am 14 Nov. 2018
A typical problem in GUI's with images or plots in an axes not updating can often be solved by adding a drawnow after the moment it should update. In your case my guess would be right before each print. In pseudo code it would look something like this in pseudo code:
I could misinterpred your question or it could be a different problem, hard to tell without sample code. If this does not solve the problem provide some sample code and example data.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Startup and Shutdown 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!