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

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

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


Revision 1.2 - (show annotations) (download)
Wed Feb 2 15:38:21 2005 UTC (20 years, 5 months ago) by enderton
Branch: MAIN
Changes since 1.1: +4 -4 lines
 o Added plotting options for actual temperature 'ActT' and moist potential temperature 'MoiPTc', though the later is calculated in a crude way.  Also changed 'exp' variables internally to 'trl' to avoid overriding exp() function.  Hopefully I got them all.

1 % DiagPlotMisc is called by DiagPlot and cannot be used seperately.
2
3
4 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5 % Apply desired colorbar, contour label, tick labels, box, grid %
6 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7
8
9 % Add colorbar, except for line plots. When the colorbar is placed, reset
10 % the colorbar and axes positions on the figure to match desired settings.
11 % Colorbar can be turned off as desired.
12 if UseColorbar
13 if ~isequal(pst,'Lin')
14 h=colorbar;
15 cxi = xi+dx-dxcb;
16 set(h,'position',[cxi,yi,dxcb,dy]);
17 set(h,'fontsize',fs_colorbar);
18 set(gca,'position',[xi,yi,dx-dxcb-dxcbg,dy]);
19 end
20 end
21
22 % Reform tick labels. It the PlotStyle (pst) is 'Lin', do nothing with the
23 % y-axis label as is it now a dependent variable.
24 if UseNiceTickLabels
25 if isequal(pltslc{inrow}{incol}(1:3),'lon')
26 xtick = lontick; xticklabel = lonticklabel;
27 elseif isequal(pltslc{inrow}{incol}(1:3),'lat')
28 xtick = lattick; xticklabel = latticklabel;
29 elseif isequal(pltslc{inrow}{incol}(1:3),'tim')
30 xtick = timtick; xticklabel = timticklabel;
31 a=1;%error('Fix me!!!')
32 end
33 set(gca,'xtick',xtick);
34 set(gca,'xticklabel',xticklabel);
35 if ~isequal(pltslc{inrow}{incol}(4:6),'fld')
36 if isequal(pltslc{inrow}{incol}(4:6),'lat')
37 ytick = lattick; yticklabel = latticklabel;
38 elseif isequal(pltslc{inrow}{incol}(4:6),'hgt')
39 eval(['ytick = vertick',flu,';']);
40 eval(['yticklabel = verticklabel',flu,';']);
41 end
42 set(gca,'ytick',ytick);
43 set(gca,'yticklabel',yticklabel);
44 end
45 end
46
47 % Add box and grid as desired.
48 eval(['box ' ,Box ,';']);
49 eval(['grid ',Grid,';']);
50
51 % Add legend if comparison is set to one of the overlay settings: 'OvE' or
52 % 'OvC'. If the 'UseLegend' flag is turned on but the comparison type is
53 % not one of these overlay settings, nothing is done.
54 if UseLegend && ismember(cmp,{'OvC','OvE','OvF'})
55 legendstr = '';
56 for intrl = 1:ntrl
57 if isequal(cmp,'OvE'), tempname = page{inrow}{intrl}{itrl};
58 elseif isequal(cmp,'OvC'), tempname = page{inrow}{intrl}{iavg};
59 elseif isequal(cmp,'OvF'), tempname = page{inrow}{intrl}{ifln}; end
60 tempname = AddSlashesBeforeUnderscores(tempname);
61 legendstr = [legendstr,'''',tempname,''','];
62 end
63 eval(['legend(',legendstr,num2str(LegendPlacement),')']);
64 end

  ViewVC Help
Powered by ViewVC 1.1.22