--- MITgcm_contrib/enderton/Diagnostics/DiagPlotMisc.m 2005/01/31 15:43:27 1.1 +++ MITgcm_contrib/enderton/Diagnostics/DiagPlotMisc.m 2005/08/10 19:58:03 1.6 @@ -5,6 +5,22 @@ % Apply desired colorbar, contour label, tick labels, box, grid % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Center caxis around 0 +if cmapcenter0 + caxis([-max(abs(caxis)),max(abs(caxis))]); +end + +% Apply desired colormap. +if ~isequal(cmap,'') + if isequal(cmap,'black') + colormap([0,0,0]); + elseif isequal(cmap,'bwr') + load('BWR_6.mat'); + colormap(bwr); + else + colormap(cmap); + end +end % Add colorbar, except for line plots. When the colorbar is placed, reset % the colorbar and axes positions on the figure to match desired settings. @@ -23,18 +39,19 @@ % y-axis label as is it now a dependent variable. if UseNiceTickLabels if isequal(pltslc{inrow}{incol}(1:3),'lon') - xtick = lontick; xticklabel = lonticklabel; + xtick = fac.*lontick; xticklabel = lonticklabel; + set(gca,'xtick',xtick); set(gca,'xticklabel',xticklabel); elseif isequal(pltslc{inrow}{incol}(1:3),'lat') - xtick = lattick; xticklabel = latticklabel; + xtick = fac.*lattick; xticklabel = latticklabel; + set(gca,'xtick',xtick); set(gca,'xticklabel',xticklabel); elseif isequal(pltslc{inrow}{incol}(1:3),'tim') - xtick = timtick; xticklabel = timticklabel; - a=1;%error('Fix me!!!') + % xtick = timtick; xticklabel = timticklabel; + % set(gca,'xtick',xtick); set(gca,'xticklabel',xticklabel); end - set(gca,'xtick',xtick); - set(gca,'xticklabel',xticklabel); + if ~isequal(pltslc{inrow}{incol}(4:6),'fld') if isequal(pltslc{inrow}{incol}(4:6),'lat') - ytick = lattick; yticklabel = latticklabel; + ytick = fac.*lattick; yticklabel = latticklabel; elseif isequal(pltslc{inrow}{incol}(4:6),'hgt') eval(['ytick = vertick',flu,';']); eval(['yticklabel = verticklabel',flu,';']); @@ -53,12 +70,21 @@ % not one of these overlay settings, nothing is done. if UseLegend && ismember(cmp,{'OvC','OvE','OvF'}) legendstr = ''; - for inexp = 1:nexp - if isequal(cmp,'OvE'), tempname = page{inrow}{inexp}{iexp}; - elseif isequal(cmp,'OvC'), tempname = page{inrow}{inexp}{iavg}; - elseif isequal(cmp,'OvF'), tempname = page{inrow}{inexp}{ifln}; end + for intrl = 1:ntrl + if isequal(cmp,'OvE'), tempname = page{inrow}{intrl}{itrl}; + elseif isequal(cmp,'OvC'), tempname = page{inrow}{intrl}{iavg}; + elseif isequal(cmp,'OvF'), tempname = page{inrow}{intrl}{ifln}; end tempname = AddSlashesBeforeUnderscores(tempname); legendstr = [legendstr,'''',tempname,''',']; end eval(['legend(',legendstr,num2str(LegendPlacement),')']); end + +% Add coast as appropriate. +if Coast + %m_proj('Mercator','lat',90,'lon',[-180,177.5]); + m_proj('Equidistant Cylindrical','lat',90,'lon',[-180 180]); + m_coast('color',[0 0 0]); + %m_grid('box','on') + %draw_coast(1.) +end