--- MITgcm_contrib/enderton/Diagnostics/DiagPlotMisc.m 2005/02/07 16:04:14 1.3 +++ 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,10 +39,10 @@ % 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; @@ -35,7 +51,7 @@ 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,';']); @@ -63,3 +79,12 @@ 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