| 1 | 
enderton | 
1.1 | 
% DiagPlotResetAxes is called by DiagPlot and cannot be used seperately. | 
| 2 | 
  | 
  | 
 | 
| 3 | 
  | 
  | 
 | 
| 4 | 
  | 
  | 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | 
| 5 | 
  | 
  | 
%                      (Re)Set color axis and axes                        %  | 
| 6 | 
  | 
  | 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | 
| 7 | 
  | 
  | 
 | 
| 8 | 
  | 
  | 
% Set the coloraxis.  It can either be set to a predefined fixed range (use | 
| 9 | 
  | 
  | 
% CaxisFixed), the plots minimum and maximum values (use CaxisMinMax), or | 
| 10 | 
  | 
  | 
% values calculated by MATLAB (set both to zero).  NOTE WHICH ONES IT | 
| 11 | 
  | 
  | 
% DOESN'T WORK FOR. | 
| 12 | 
  | 
  | 
if ~isequal(pst,'Lin')    | 
| 13 | 
  | 
  | 
        if CaxisFixed | 
| 14 | 
  | 
  | 
        if ismember(cmp,{'Sep','Sbs'}) | 
| 15 | 
  | 
  | 
            try | 
| 16 | 
  | 
  | 
                eval(['caxis(',fln,'range',flu,');']); | 
| 17 | 
  | 
  | 
            end | 
| 18 | 
  | 
  | 
        end | 
| 19 | 
  | 
  | 
        elseif CaxisMinMax | 
| 20 | 
  | 
  | 
        if ismember(cmp,{'Sep','Dif','Sbs'}) | 
| 21 | 
  | 
  | 
            caxis([min(plotdata(:)),max(plotdata(:))]); | 
| 22 | 
  | 
  | 
        end | 
| 23 | 
  | 
  | 
        end | 
| 24 | 
  | 
  | 
end | 
| 25 | 
  | 
  | 
 | 
| 26 | 
  | 
  | 
% Reset the axis.  It can either be set to the axis limits (use AxesFixed), | 
| 27 | 
  | 
  | 
% the x-axis can be trimmed (use AxesTrimX) to avoid the sometimes | 
| 28 | 
  | 
  | 
% appearing white space, or the axis values calculated by MATLAB can be | 
| 29 | 
  | 
  | 
% used (use nothing).  CURRENTLY NOT DEFINED FOR CS DATA!!! | 
| 30 | 
  | 
  | 
if AxesTrimX | 
| 31 | 
  | 
  | 
    if ~isCS | 
| 32 | 
  | 
  | 
        set(gca,'xlim',[min(xax{inrow}{incol}(:)),... | 
| 33 | 
  | 
  | 
                        max(xax{inrow}{incol}(:))]); | 
| 34 | 
  | 
  | 
    end | 
| 35 | 
  | 
  | 
end | 
| 36 | 
  | 
  | 
if AxesTrimY | 
| 37 | 
  | 
  | 
    if ~ismember(pltslc{inrow}{incol},{'lonfld','latfld'}) && ~isCS | 
| 38 | 
  | 
  | 
        set(gca,'ylim',[min(yax{inrow}{incol}(:)),... | 
| 39 | 
  | 
  | 
                        max(yax{inrow}{incol}(:))]); | 
| 40 | 
  | 
  | 
    end | 
| 41 | 
  | 
  | 
end | 
| 42 | 
  | 
  | 
 | 
| 43 | 
  | 
  | 
% Limit y range -- Good for looking at upper layer of ocean. | 
| 44 | 
  | 
  | 
if isequal(flu,'O') && ~isempty(ylimO),  set(gca,'ylim',ylimO); end | 
| 45 | 
  | 
  | 
if isequal(flu,'A') && ~isempty(ylimA),  set(gca,'ylim',ylimA); end | 
| 46 | 
  | 
  | 
 | 
| 47 | 
  | 
  | 
% If this is a Dimension-height plot, the axis must be flipped. | 
| 48 | 
  | 
  | 
if ismember(pltslc{inrow}{incol},{'lonhgt','lathgt'}) && isequal(flu,'A') | 
| 49 | 
  | 
  | 
    set(gca,'ydir','reverse'); | 
| 50 | 
  | 
  | 
end |