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 inexp = 1:nexp |
57 |
if isequal(cmp,'OvE'), tempname = page{inrow}{inexp}{iexp}; |
58 |
elseif isequal(cmp,'OvC'), tempname = page{inrow}{inexp}{iavg}; |
59 |
elseif isequal(cmp,'OvF'), tempname = page{inrow}{inexp}{ifln}; end |
60 |
tempname = AddSlashesBeforeUnderscores(tempname); |
61 |
legendstr = [legendstr,'''',tempname,''',']; |
62 |
end |
63 |
eval(['legend(',legendstr,num2str(LegendPlacement),')']); |
64 |
end |