Warning, /utils/matlab/Graphix/GraphixPlotResetAxes.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 % DiagPlotResetAxes is called by DiagPlot and cannot be used seperately.
0002
0003
0004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0005 % (Re)Set color axis and axes %
0006 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0007
0008 % Set the coloraxis. It can either be set to a predefined fixed range (use
0009 % CaxisFixed), the plots minimum and maximum values (use CaxisMinMax), or
0010 % values calculated by MATLAB (set both to zero). Also check range.
0011 datarange = [min(plotdata(:)),max(plotdata(:))];
0012 try
0013 eval(['fixedrange = ',fln,'range',flu,';']);
0014 if datarange(1) < fixedrange(1) | ...
0015 datarange(2) > fixedrange(2)
0016 disp(['***Warning*** Value out of range for ',fln]);
0017 disp([' Data range: ',mat2str(datarange)]);
0018 disp([' Fixed range: ',mat2str(fixedrange)]);
0019 end
0020 catch
0021 disp(['***Warning*** No range information found.']);
0022 disp([' Data range: ',mat2str(datarange)]);
0023 end
0024 if ~isequal(pst,'Lin')
0025 try caxis(crange);
0026 catch
0027 if CaxisFixed
0028 if ismember(cmp,{'Sep','Sbs'})
0029 try
0030 eval(['caxis(',fln,'range',flu,');']);
0031 end
0032 end
0033 elseif CaxisMinMax
0034 if ismember(cmp,{'Sep','Dif','Sbs'})
0035 caxis([min(plotdata(:)),max(plotdata(:))]);
0036 end
0037 end
0038 end
0039 end
0040
0041 % Reset the axis. It can either be set to the axis limits (use AxesFixed),
0042 % the x-axis can be trimmed (use AxesTrimX) to avoid the sometimes
0043 % appearing white space, or the axis values calculated by MATLAB can be
0044 % used (use nothing). CURRENTLY NOT DEFINED FOR CS DATA!!!
0045 if AxesTrimX
0046 if ~isCS
0047 set(gca,'xlim',[min(xax{inrow}{incol}(:)),...
0048 max(xax{inrow}{incol}(:))]);
0049 end
0050 end
0051 if AxesTrimY
0052 if ~ismember(pltslc{inrow}{incol},{'lonfld','latfld','timfld'}) && ~isCS
0053 set(gca,'ylim',[min(yax{inrow}{incol}(:)),...
0054 max(yax{inrow}{incol}(:))]);
0055 end
0056 end
0057
0058 % Limit y range -- Good for looking at upper layer of ocean.
0059 if isequal(flu,'O') && ~isempty(ylimO) && ...
0060 isequal(pltslc{inrow}{incol}(4:6),'hgt'), set(gca,'ylim',ylimO); end
0061 if isequal(flu,'A') && ~isempty(ylimA) && ...
0062 isequal(pltslc{inrow}{incol}(4:6),'hgt'), set(gca,'ylim',ylimA); end
4cf7d6e47a Dani*0063 if ~isempty(xlim), set(gca,'xlim',xlim); end
0064 if ~isempty(ylim) && isequal(pltslc{inrow}{incol}(4:6),'fld')
0065 set(gca,'ylim',ylim); end
0066
5bbd0d07c9 Dani*0067
0068 % If this is a Dimension-height plot, the axis must be flipped.
0069 if ismember(pltslc{inrow}{incol},{'lonhgt','lathgt'}) && isequal(flu,'A')
0070 set(gca,'ydir','reverse');
0071 end