% Plot Stack Section
maxstk=0.2*max(stack(:));
figure;
subplot(121)
imagesc(x,[1:nt]*dt,stack',[-maxstk maxstk]);
title('Stacked Section','FontSize',18);
xlabel('X (m)','FontSize',16);
ylabel('TWT (msec)','FontSize',16);
subplot(122)
imagesc(x,t,stack(:,TOTS:TOTE)',[-maxstk maxstk]);
title('Stacked Section (Time-windowed)','FontSize',18);
xlabel('X (m)','FontSize',16);
ylabel('TWT (msec)','FontSize',16);
colormap('gray')