how i print figure in a loop?
Show older comments
i made a pcolor figure animation using a loop. i want to print each figure as jpg file. please help me
code: clc; clear; load('SSHA_all_199301-201202.mat') lon=SSHA.lon; lat=SSHA.lat; time=SSHA.time; ssha=SSHA.data;
[x y]=meshgrid(lon,lat); str=datestr(time,'mm-yyyy');
for n=1:length(time)
pcolor(x,y,ssha(:,:,n));
shading interp
colorbar
caxis([-40 40])
title(str(n,:))
pause(0.01)
end
Answers (1)
Image Analyst
on 9 Jun 2015
0 votes
See the FAQ: http://matlab.wikia.com/wiki/FAQ#How_do_I_save_my_figure.2C_axes.2C_or_image.3F_I.27m_having_trouble_with_the_built_in_MATLAB_functions. and use export_fig().
1 Comment
Image Analyst
on 9 Jun 2015
Also, see my attached demo.
Categories
Find more on Animation 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!