function plotSQ(SQ,j,k) % plotSQ plot TS diagram from Climatology % % First, load the SQ structure as: % >> load('climSQ.mat'); % B), Call as: % >> plotSQ(SQ,j,k) % tmin=2;tmax=30; smin=34;smax=37; rmin=1020;rmax=1030; nr=11; n=25; [tgrid,sgrid]=meshgrid(linspace(tmin,tmax,n),linspace(smin,smax,n)); rho=sw_dens0(sgrid,tgrid); [c,h]=contour(sgrid,tgrid,rho,linspace(rmin,rmax,nr)); set(h,'EdgeColor','k') clabel(c,h) datasqu=[SQ(j,k).T SQ(j,k).S SQ(j,k).Z SQ(j,k).D]; idx=find(datasqu(:,4)>200); line(datasqu(idx,2),datasqu(idx,1),'Color','r','Marker','.','LineStyle','none','MarkerSize',14); idx=find(datasqu(:,4)<=200); line(datasqu(idx,2),datasqu(idx,1),'Color','g','Marker','.','LineStyle','none','MarkerSize',14); line(SQ(j,k).Savg,SQ(j,k).Tavg,'Color','k') axis([34 37 2 30]); xlabel('S') ylabel('T') title(['TS from square ' int2str(j) ',' int2str(k)],'FontSize',17) grid