/[MITgcm]/MITgcm_contrib/enderton/Diagnostics/DiagPlotResetAxes.m
ViewVC logotype

Contents of /MITgcm_contrib/enderton/Diagnostics/DiagPlotResetAxes.m

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.3 - (show annotations) (download)
Wed Aug 10 19:58:04 2005 UTC (19 years, 11 months ago) by enderton
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +16 -13 lines
Added functionality to specify colormap, overridding and/or centering caxis.

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 try caxis(crange);
14 catch
15 if CaxisFixed
16 if ismember(cmp,{'Sep','Sbs'})
17 try
18 eval(['caxis(',fln,'range',flu,');']);
19 end
20 end
21 elseif CaxisMinMax
22 if ismember(cmp,{'Sep','Dif','Sbs'})
23 caxis([min(plotdata(:)),max(plotdata(:))]);
24 end
25 end
26 end
27 end
28
29 % Reset the axis. It can either be set to the axis limits (use AxesFixed),
30 % the x-axis can be trimmed (use AxesTrimX) to avoid the sometimes
31 % appearing white space, or the axis values calculated by MATLAB can be
32 % used (use nothing). CURRENTLY NOT DEFINED FOR CS DATA!!!
33 if AxesTrimX
34 if ~isCS
35 set(gca,'xlim',[min(xax{inrow}{incol}(:)),...
36 max(xax{inrow}{incol}(:))]);
37 end
38 end
39 if AxesTrimY
40 if ~ismember(pltslc{inrow}{incol},{'lonfld','latfld','timfld'}) && ~isCS
41 set(gca,'ylim',[min(yax{inrow}{incol}(:)),...
42 max(yax{inrow}{incol}(:))]);
43 end
44 end
45
46 % Limit y range -- Good for looking at upper layer of ocean.
47 if isequal(flu,'O') && ~isempty(ylimO) && ...
48 isequal(pltslc{inrow}{incol}(4:6),'hgt'), set(gca,'ylim',ylimO); end
49 if isequal(flu,'A') && ~isempty(ylimA) && ...
50 isequal(pltslc{inrow}{incol}(4:6),'hgt'), set(gca,'ylim',ylimA); end
51
52 % If this is a Dimension-height plot, the axis must be flipped.
53 if ismember(pltslc{inrow}{incol},{'lonhgt','lathgt'}) && isequal(flu,'A')
54 set(gca,'ydir','reverse');
55 end

  ViewVC Help
Powered by ViewVC 1.1.22