--- MITgcm_contrib/enderton/Diagnostics/DiagPlotResetAxes.m 2005/02/07 05:31:45 1.2 +++ MITgcm_contrib/enderton/Diagnostics/DiagPlotResetAxes.m 2005/08/10 19:58:04 1.3 @@ -9,18 +9,21 @@ % CaxisFixed), the plots minimum and maximum values (use CaxisMinMax), or % values calculated by MATLAB (set both to zero). NOTE WHICH ONES IT % DOESN'T WORK FOR. -if ~isequal(pst,'Lin') - if CaxisFixed - if ismember(cmp,{'Sep','Sbs'}) - try - eval(['caxis(',fln,'range',flu,');']); +if ~isequal(pst,'Lin') + try caxis(crange); + catch + if CaxisFixed + if ismember(cmp,{'Sep','Sbs'}) + try + eval(['caxis(',fln,'range',flu,');']); + end end - end - elseif CaxisMinMax - if ismember(cmp,{'Sep','Dif','Sbs'}) - caxis([min(plotdata(:)),max(plotdata(:))]); - end - end + elseif CaxisMinMax + if ismember(cmp,{'Sep','Dif','Sbs'}) + caxis([min(plotdata(:)),max(plotdata(:))]); + end + end + end end % Reset the axis. It can either be set to the axis limits (use AxesFixed), @@ -42,9 +45,9 @@ % Limit y range -- Good for looking at upper layer of ocean. if isequal(flu,'O') && ~isempty(ylimO) && ... - ~isequal(pltslc{inrow}{incol}(4:6),'fld'), set(gca,'ylim',ylimO); end + isequal(pltslc{inrow}{incol}(4:6),'hgt'), set(gca,'ylim',ylimO); end if isequal(flu,'A') && ~isempty(ylimA) && ... - ~isequal(pltslc{inrow}{incol}(4:6),'fld'), set(gca,'ylim',ylimA); end + isequal(pltslc{inrow}{incol}(4:6),'hgt'), set(gca,'ylim',ylimA); end % If this is a Dimension-height plot, the axis must be flipped. if ismember(pltslc{inrow}{incol},{'lonhgt','lathgt'}) && isequal(flu,'A')