Back to home page

MITgcm

 
 

    


Warning, /utils/matlab/Graphix/GraphixPlotMisc.m is written in an unsupported language. File is not indexed.

view on githubraw file Latest commit 4cf7d6e4 on 2006-06-29 18:52:07 UTC
5bbd0d07c9 Dani*0001 % DiagPlotMisc is called by DiagPlot and cannot be used seperately.
                0002 
                0003 
                0004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                0005 %      Apply desired colorbar, contour label, tick labels, box, grid      %
                0006 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                0007 
                0008 % Center caxis around 0
                0009 if cmapcenter0
                0010     caxis([-max(abs(caxis)),max(abs(caxis))]);
                0011 end
                0012 
                0013 % Apply desired colormap.
                0014 if ~isequal(cmap,'')
                0015     if isequal(cmap,'solid-dashed')
                0016         % Accounted for in DiagPlotMakePlot.
                0017     elseif isequal(cmap,'black')
                0018         colormap([0,0,0]);
                0019     elseif isequal(cmap,'bwr')
                0020         load('BWR_6.mat');
                0021         colormap(bwr);
                0022     else
                0023         colormap(cmap);
                0024     end
                0025 end
                0026 
                0027 % Add colorbar, except for line plots.  When the colorbar is placed, reset
                0028 % the colorbar and axes positions on the figure to match desired settings.
                0029 % Colorbar can be turned off as desired.
                0030 if UseColorbar
                0031     if ~isequal(pst,'Lin')
                0032         h=colorbar;
                0033         cxi = xi+dx-dxcb;
                0034         set(h,'position',[cxi,yi,dxcb,dy]);
                0035         set(h,'fontsize',fs_colorbar);
                0036         set(gca,'position',[xi,yi,dx-dxcb-dxcbg,dy]);
                0037     end
                0038 end
                0039 
                0040 % Reform tick labels.  It the PlotStyle (pst) is 'Lin', do nothing with the
                0041 % y-axis label as is it now a dependent variable.
                0042 if UseNiceTickLabels
                0043     if isequal(pltslc{inrow}{incol}(1:3),'lon')
                0044         xtick = fac.*lontick; xticklabel = lonticklabel;
                0045         set(gca,'xtick',xtick); set(gca,'xticklabel',xticklabel);       
                0046     elseif isequal(pltslc{inrow}{incol}(1:3),'lat')
                0047         xtick = fac.*lattick; xticklabel = latticklabel;
                0048         set(gca,'xtick',xtick); set(gca,'xticklabel',xticklabel);  
                0049     elseif isequal(pltslc{inrow}{incol}(1:3),'tim')
                0050         % xtick = timtick; xticklabel = timticklabel;
                0051         % set(gca,'xtick',xtick); set(gca,'xticklabel',xticklabel);  
                0052     end
                0053 
                0054     if ~isequal(pltslc{inrow}{incol}(4:6),'fld')
                0055         if isequal(pltslc{inrow}{incol}(4:6),'lat')
                0056             ytick = fac.*lattick;  yticklabel = latticklabel;
                0057         elseif isequal(pltslc{inrow}{incol}(4:6),'hgt')
                0058             eval(['ytick = vertick',flu,';']);
                0059             eval(['yticklabel = verticklabel',flu,';']);
                0060         end
                0061         set(gca,'ytick',ytick);
                0062         set(gca,'yticklabel',yticklabel);
                0063     end
                0064 end
4cf7d6e47a Dani*0065 set(gca,'tickdir',TickDir);
5bbd0d07c9 Dani*0066 
                0067 % Add box and grid as desired.
                0068 eval(['box ' ,Box ,';']);
                0069 eval(['grid ',Grid,';']);
                0070 
                0071 % Add legend if comparison is set to one of the overlay settings:  'OvE' or
                0072 % 'OvC'.  If the 'UseLegend' flag is turned on but the comparison type is
                0073 % not one of these overlay settings, nothing is done.
                0074 if UseLegend && ismember(cmp,{'OvC','OvE','OvF'})
                0075     legendstr = '';
                0076     for intrl = 1:ntrl
                0077         if     isequal(cmp,'OvE'), tempname = page{inrow}{intrl}{itrl};
                0078         elseif isequal(cmp,'OvC'), tempname = page{inrow}{intrl}{iavg};
                0079         elseif isequal(cmp,'OvF'), tempname = page{inrow}{intrl}{ifln}; end
                0080         tempname = AddSlashesBeforeUnderscores(tempname);
                0081         legendstr = [legendstr,'''',tempname,''','];
                0082     end
                0083     eval(['legend(',legendstr,num2str(LegendPlacement),')']);
                0084 end
                0085 
                0086 % Add coast as appropriate.
                0087 if Coast
                0088     m_proj('Equidistant Cylindrical','lat',90,'lon',[-180 180]);
                0089     m_coast('color',[0 0 0]);
                0090 end
4cf7d6e47a Dani*0091 
                0092 % Add cube lines.
                0093 if Edges
                0094     drawedges(XG{inrow}{incol},YG{inrow}{incol});
                0095 end
                0096 
                0097 % Add text box
                0098 if ~isequal(TextBox,'')
                0099     h = text(TextPos(1),TextPos(2),TextBox,'units','normalized',...
                0100              'backgroundcolor',[1,1,1],'edgecolor',[0,0,0],'fontsize',...
                0101              fs_textbox,'verticalalignment','bottom');
                0102 end