Saving resized figures in loop does all but last correctly
1 view (last 30 days)
Show older comments
I am trying to save all my figures after resizing them to fit my entire screen. I use a loop to go through the figures, however, while the last figure is resized correctly it is not saved as a png at the correct size. This is true no matter the order I save the figures. Any tips on how to solve this? Below is a small snippet of code:
h = findall(groot, 'Type', 'figure');
for numFig = 1:length(h)
figure(numFig)
set(numFig, 'Position', get(0, 'Screensize'));
saveas(h(numFig), [tempLoc, h(numFig).Name, '.png'])
end
0 Comments
Accepted Answer
See Also
Categories
Find more on Printing and Saving in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!