--- MITgcm_contrib/enderton/Diagnostics/DiagPlot.m 2005/01/31 15:43:27 1.1 +++ MITgcm_contrib/enderton/Diagnostics/DiagPlot.m 2005/04/29 17:34:39 1.5 @@ -40,9 +40,9 @@ % Loop over subplots and make plots. for inrow = 1:nrow - nexp = length(page{inrow}); if nexp ~= 1, nexp = nexp - 1; end - if nexp == 1, cmp = 'Sep'; else, cmp = page{inrow}{end}; end - if nexp == 1, ncol = 1; elseif cmp == 'Sbs', ncol = nexp; else ncol = 1; end + ntrl = length(page{inrow}); if ntrl ~= 1, ntrl = ntrl - 1; end + if ntrl == 1, cmp = 'Sep'; else, cmp = page{inrow}{end}; end + if ntrl == 1, ncol = 1; elseif cmp == 'Sbs', ncol = ntrl; else ncol = 1; end dx = (1-dxl-dxr-(ncol-1)*dxm)/ncol; dy = (1-dyb-dyt-(nrow-1)*dym)/nrow; @@ -56,6 +56,7 @@ % Set panel settings to default values, override with optional % settings. + DiagPlotDefaults; ExpInfo = page{inrow}{incol}; for iarg = 14:2:length(ExpInfo) if ~ismember(ExpInfo{iarg},diagrunparam) @@ -89,9 +90,17 @@ yi = 1-dyt-inrow*dy-(inrow-1)*dym; isp = (inrow-1)*ncol+incol; + if DiagDebug, disp([' DiagDebug: Subplot: ',mat2str([nrow,ncol,isp])]); end + if DiagDebug, disp([' DiagDebug: SP Range: ',mat2str([xi,yi,dx,dy])]); end subplot(nrow,ncol,isp); hold on; set(gca,'position',[xi,yi,dx,dy],'fontsize',fs_axis); + if Coast + fac = pi./180; + xax{inrow}{incol} = xax{inrow}{incol}.*fac; + yax{inrow}{incol} = yax{inrow}{incol}.*fac; + else, fac = 1; end + % (Re)set axes and color axis -- Accounts for things like a possible % colorbar, or trimming the axis in certain ways. % Apply desired colorbar, contour label, tick labels, box, grid, and @@ -111,6 +120,10 @@ % Save plot as desired. if SavePlots - outputfile = [outputdir,'/',pagename,'.eps']; + if isequal(outputdir,'') + outputfile = [pagename,'.eps']; + else + outputfile = [outputdir,'/',pagename,'.eps']; + end print('-depsc2',outputfile); end