Back to home page

MITgcm

 
 

    


Warning, /utils/matlab/Graphix/GraphixPlotMakePlot.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 % DiagPlotMakePlot is called by DiagPlot and cannot be used seperately.
                0002 
                0003 
                0004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                0005 %                                 Make plot                               %
                0006 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                0007 if isequal(cmp,'Dif')
                0008     plotdata = data{inrow}{1} - data{inrow}{2};
                0009 else
                0010     plotdata = data{inrow}{incol};
                0011 end
4cf7d6e47a Dani*0012 plotdata = plotdata + offset;
                0013 % [min(plotdata(:)),max(plotdata(:))]
                0014 % size(plotdata)
                0015 % size(xax{inrow}{incol})
                0016 % size(yax{inrow}{incol})
                0017 % plotdata
                0018 % x = xax{inrow}{incol};
                0019 % y = yax{inrow}{incol};
                0020 % save('Dump.mat','plotdata','x','y');
5bbd0d07c9 Dani*0021 
                0022 % Make gridded plot.  This should be fixed up to allow for non-constant
                0023 % height intervals, imagesc makes everything equally spaced in the vertical
                0024 % (and in the horizontal for that matter).
                0025 if isequal(pst,'Grd')
                0026     if isCS
                0027         merccube_mod(xax{inrow}{incol},yax{inrow}{incol},plotdata);
                0028     else
                0029         imagesc(xax{inrow}{incol},yax{inrow}{incol},plotdata);
                0030     end
4cf7d6e47a Dani*0031     if isequal(Shading,'interp')
                0032         shading interp;
                0033     end
5bbd0d07c9 Dani*0034     
                0035 % Make interpolated plot.
                0036 elseif isequal(pst,'Int')
                0037     if isCS
                0038         merccube_mod(xax{inrow}{incol},yax{inrow}{incol},plotdata);
                0039         shading interp;
                0040     else
                0041         pcolor(xax{inrow}{incol},yax{inrow}{incol},plotdata);
                0042         shading interp;
                0043     end
                0044     
                0045 % Make contour (non-filled) plot.
                0046 elseif isequal(pst,'Con')
                0047     hold off;
                0048     if isequal(cmap,'solid-dashed')
                0049         for ii = 1:3
                0050             cint = contint; lw = linewidth;
                0051             pr = [min(plotdata(:)),max(plotdata(:))];
                0052             if ii == 1, cint = cint(cint>0); lst = '-'; end
                0053             if ii == 2, cint = cint(cint<0); lst = '--'; end
                0054             if ii == 3, cint = [0,0]; lst = '-'; lw = 2.*lw; end
                0055             Lines = 0;
                0056             for icint = 1:length(cint)
                0057                 Lines = Lines | (cint(icint)>pr(1) & cint(icint)<pr(2));   
                0058             end
                0059             if Lines
                0060                 [cs,h] = contour(xax{inrow}{incol},...
                0061                                  yax{inrow}{incol},...
                0062                                  plotdata,cint,['k',lst]);
                0063                 set(h,'linewidth',lw);
                0064                 if UseConLabel
4cf7d6e47a Dani*0065                     clabel(cs,h,clabelv,'fontsize',fs_clabel,'rotation',...
                0066                            0,'labelspacing',labelspacing);
5bbd0d07c9 Dani*0067                 end
                0068                 hold on;
                0069             end
                0070         end
                0071     else
                0072         [cs,h] = contour(xax{inrow}{incol},...
                0073                          yax{inrow}{incol},...
                0074                          plotdata,contint);
4cf7d6e47a Dani*0075         return
5bbd0d07c9 Dani*0076         set(h,'linewidth',linewidth);
                0077         if UseConLabel
4cf7d6e47a Dani*0078             clabel(cs,h,clabelv,'fontsize',fs_clabel,'rotation',0,...
5bbd0d07c9 Dani*0079                    'labelspacing',labelspacing);
                0080         end
                0081     end
                0082     
                0083 % Make contour (filled) plot.  Let MATLAB determine the contour
                0084 % intervals on a differencing plot.
                0085 elseif isequal(pst,'Cnf')
                0086     try   [cs,h] = contourf(xax{inrow}{incol},yax{inrow}{incol},plotdata,contint);
                0087     catch [cs,h] = contourf(xax{inrow}{incol},yax{inrow}{incol},plotdata); end
                0088     if UseCnfLabel
4cf7d6e47a Dani*0089         clabel(cs,h,clabelv,'fontsize',fs_clabel,'rotation',0,...
5bbd0d07c9 Dani*0090                'labelspacing',labelspacing);
                0091     end
                0092     
                0093 % Make line plot.  If this is an overlaying comparison, cycle through the
                0094 % appropriate data of which to overlay.
                0095 elseif isequal(pst,'Lin')
                0096     if ismember(cmp,{'OvC','OvE','OvF'})
                0097         for intrl = 1:ntrl
                0098             plot(xax{inrow}{intrl},data{inrow}{intrl},...
                0099                  linecolors{intrl},'linewidth',linewidth);
                0100         end
                0101     else
                0102         plot(xax{inrow}{incol},plotdata,linecolors{1},'linewidth',linewidth);
                0103     end
                0104     
                0105 % Unknown plot style encountered.
                0106 else
                0107     error(['Oh dear!  Undefined PlotStyle:  ',pst]);
                0108 end