function plot3(NX,NZ,NT,dx,dt,c,RES,BVEL,res,REALDATA,SYNDATA,nit)
  subplot(311);XL='Offset (ft)';ZL='Depth (ft)';
plot([2:nit],res(2:nit),'*',[2:nit],res(2:nit));title('L2 Seismogram Residual vs Iteration Number');
 xlabel('Iteration Number');ylabel('Residual'); subplot(312);
 plot1(NX,NZ,dx,dx,BVEL,['Reconstructed Velocity Model at Iteration = ',num2str(nit)],XL,ZL);subplot(313);
plot([150:NT]*dt,REALDATA(NX/2,150:NT)/max(REALDATA(NX/2,150:NT) ),'--');hold on;ylabel('Amplitude');
plot([150:NT]*dt,SYNDATA(NX/2,150:NT)/max(SYNDATA(NX/2,150:NT)),'-');ylabel('Amplitude'); xlabel('Time (s)')
;title('Observed (--) vs Predicted (-) Seismograms');  axis([150*dt NT*dt -1 1]);hold off;
 figure(1) 
