| 1 | enderton | 1.1 | % DiagPlotMisc is called by DiagPlot and cannot be used seperately. | 
| 2 |  |  |  | 
| 3 |  |  |  | 
| 4 |  |  | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | 
| 5 |  |  | %      Apply desired colorbar, contour label, tick labels, box, grid      % | 
| 6 |  |  | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | 
| 7 |  |  |  | 
| 8 | enderton | 1.6 | % Center caxis around 0 | 
| 9 |  |  | if cmapcenter0 | 
| 10 |  |  | caxis([-max(abs(caxis)),max(abs(caxis))]); | 
| 11 |  |  | end | 
| 12 |  |  |  | 
| 13 |  |  | % Apply desired colormap. | 
| 14 |  |  | if ~isequal(cmap,'') | 
| 15 | enderton | 1.7 | if isequal(cmap,'solid-dashed') | 
| 16 |  |  | % Accounted for in DiagPlotMakePlot. | 
| 17 |  |  | elseif isequal(cmap,'black') | 
| 18 | enderton | 1.6 | colormap([0,0,0]); | 
| 19 |  |  | elseif isequal(cmap,'bwr') | 
| 20 |  |  | load('BWR_6.mat'); | 
| 21 |  |  | colormap(bwr); | 
| 22 |  |  | else | 
| 23 |  |  | colormap(cmap); | 
| 24 |  |  | end | 
| 25 |  |  | end | 
| 26 | enderton | 1.1 |  | 
| 27 |  |  | % Add colorbar, except for line plots.  When the colorbar is placed, reset | 
| 28 |  |  | % the colorbar and axes positions on the figure to match desired settings. | 
| 29 |  |  | % Colorbar can be turned off as desired. | 
| 30 |  |  | if UseColorbar | 
| 31 |  |  | if ~isequal(pst,'Lin') | 
| 32 |  |  | h=colorbar; | 
| 33 |  |  | cxi = xi+dx-dxcb; | 
| 34 |  |  | set(h,'position',[cxi,yi,dxcb,dy]); | 
| 35 |  |  | set(h,'fontsize',fs_colorbar); | 
| 36 |  |  | set(gca,'position',[xi,yi,dx-dxcb-dxcbg,dy]); | 
| 37 |  |  | end | 
| 38 |  |  | end | 
| 39 |  |  |  | 
| 40 |  |  | % Reform tick labels.  It the PlotStyle (pst) is 'Lin', do nothing with the | 
| 41 |  |  | % y-axis label as is it now a dependent variable. | 
| 42 |  |  | if UseNiceTickLabels | 
| 43 |  |  | if isequal(pltslc{inrow}{incol}(1:3),'lon') | 
| 44 | molod | 1.4 | xtick = fac.*lontick; xticklabel = lonticklabel; | 
| 45 | enderton | 1.3 | set(gca,'xtick',xtick); set(gca,'xticklabel',xticklabel); | 
| 46 | enderton | 1.1 | elseif isequal(pltslc{inrow}{incol}(1:3),'lat') | 
| 47 | molod | 1.4 | xtick = fac.*lattick; xticklabel = latticklabel; | 
| 48 | enderton | 1.3 | set(gca,'xtick',xtick); set(gca,'xticklabel',xticklabel); | 
| 49 | enderton | 1.1 | elseif isequal(pltslc{inrow}{incol}(1:3),'tim') | 
| 50 | enderton | 1.3 | % xtick = timtick; xticklabel = timticklabel; | 
| 51 |  |  | % set(gca,'xtick',xtick); set(gca,'xticklabel',xticklabel); | 
| 52 | enderton | 1.1 | end | 
| 53 | enderton | 1.3 |  | 
| 54 | enderton | 1.1 | if ~isequal(pltslc{inrow}{incol}(4:6),'fld') | 
| 55 |  |  | if isequal(pltslc{inrow}{incol}(4:6),'lat') | 
| 56 | molod | 1.4 | ytick = fac.*lattick;  yticklabel = latticklabel; | 
| 57 | enderton | 1.1 | elseif isequal(pltslc{inrow}{incol}(4:6),'hgt') | 
| 58 |  |  | eval(['ytick = vertick',flu,';']); | 
| 59 |  |  | eval(['yticklabel = verticklabel',flu,';']); | 
| 60 |  |  | end | 
| 61 |  |  | set(gca,'ytick',ytick); | 
| 62 |  |  | set(gca,'yticklabel',yticklabel); | 
| 63 |  |  | end | 
| 64 |  |  | end | 
| 65 |  |  |  | 
| 66 |  |  | % Add box and grid as desired. | 
| 67 |  |  | eval(['box ' ,Box ,';']); | 
| 68 |  |  | eval(['grid ',Grid,';']); | 
| 69 |  |  |  | 
| 70 |  |  | % Add legend if comparison is set to one of the overlay settings:  'OvE' or | 
| 71 |  |  | % 'OvC'.  If the 'UseLegend' flag is turned on but the comparison type is | 
| 72 |  |  | % not one of these overlay settings, nothing is done. | 
| 73 |  |  | if UseLegend && ismember(cmp,{'OvC','OvE','OvF'}) | 
| 74 |  |  | legendstr = ''; | 
| 75 | enderton | 1.2 | for intrl = 1:ntrl | 
| 76 |  |  | if     isequal(cmp,'OvE'), tempname = page{inrow}{intrl}{itrl}; | 
| 77 |  |  | elseif isequal(cmp,'OvC'), tempname = page{inrow}{intrl}{iavg}; | 
| 78 |  |  | elseif isequal(cmp,'OvF'), tempname = page{inrow}{intrl}{ifln}; end | 
| 79 | enderton | 1.1 | tempname = AddSlashesBeforeUnderscores(tempname); | 
| 80 |  |  | legendstr = [legendstr,'''',tempname,''',']; | 
| 81 |  |  | end | 
| 82 |  |  | eval(['legend(',legendstr,num2str(LegendPlacement),')']); | 
| 83 |  |  | end | 
| 84 | molod | 1.4 |  | 
| 85 |  |  | % Add coast as appropriate. | 
| 86 |  |  | if Coast | 
| 87 |  |  | %m_proj('Mercator','lat',90,'lon',[-180,177.5]); | 
| 88 |  |  | m_proj('Equidistant Cylindrical','lat',90,'lon',[-180 180]); | 
| 89 |  |  | m_coast('color',[0 0 0]); | 
| 90 |  |  | %m_grid('box','on') | 
| 91 | molod | 1.5 | %draw_coast(1.) | 
| 92 | molod | 1.4 | end |