Hi,
It was previously working but now I am getting an empty plot in the second subplot after the first iteration. Code is as follows:
for i=1:10:length(tu) ax1= subplot(2,1,1) pcolor(lontemp(findnearest(150,lontemp):findnearest(160, lontemp)),lattemp, hc') Y1=get(gca,'ylim'); set(ax1,'dataaspectratio',[.7 cos((Y1(2)+Y1(1))/5/180*pi) 1], 'position',[0.204,0.5,0.55,0.42]) ax2=subplot(2,1,2) if i==1 curve1=animatedline; curve2=animatedline; curve3=animatedline; curve2.Color='blue'; curve3.Color='red'; set(ax2,'Xlim',[1 365],'Ylim', [min(T1) max(T1)], 'Position',[0.13,0.11,0.775,0.29], 'plotboxaspectratio',[1,0.31,0.31]) grid on addpoints(curve1,m(i),n(i)); hold on addpoints(curve2,m(i),T1(i)); addpoints(curve3,m(i),T2(i)); drawnow; pause(0.1) else grid on addpoints(curve1,m(i),n(i)); addpoints(curve2,m(i),T1(i)); addpoints(curve3,m(i),T2(i)); drawnow; pause(.1); endend
Best Answer