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

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

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


Revision 1.6 - (show annotations) (download)
Mon Sep 12 20:13:21 2005 UTC (19 years, 10 months ago) by enderton
Branch: MAIN
Changes since 1.5: +20 -5 lines
Option for contour plots with positive values solid, negative dashed, and 0 values thick solid.  Set 'cmap' to 'sold-dashed' in DiagPlotDefaults.m or within DiagRun submission to ulitize.

1 % DiagPlotMakePlot is called by DiagPlot and cannot be used seperately.
2
3
4 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5 % Make plot %
6 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7 if isequal(cmp,'Dif')
8 plotdata = data{inrow}{1} - data{inrow}{2};
9 else
10 plotdata = data{inrow}{incol};
11 end
12
13
14 % Make gridded plot. This should be fixed up to allow for non-constant
15 % height intervals, imagesc makes everything equally spaced in the vertical
16 % (and in the horizontal for that matter).
17 if isequal(pst,'Grd')
18 if isCS
19 merccube_mod(xax{inrow}{incol},yax{inrow}{incol},plotdata);
20 else
21 imagesc(xax{inrow}{incol},yax{inrow}{incol},plotdata);
22 end
23
24 % Make interpolated plot.
25 elseif isequal(pst,'Int')
26 if isCS
27 merccube_mod(xax{inrow}{incol},yax{inrow}{incol},plotdata);
28 shading interp;
29 else
30 pcolor(xax{inrow}{incol},yax{inrow}{incol},plotdata);
31 shading interp;
32 end
33
34 % Make contour (non-filled) plot. Let MATLAB determine the contour
35 % intervals on a differencing plot.
36 elseif isequal(pst,'Con')
37 if isequal(cmap,'solid-dashed')
38 for ii = 1:3
39 cint = contint; lw = linewidth;
40 if ii == 1, cint = cint(cint>0); lst = '-'; end
41 if ii == 2, cint = cint(cint<0); lst = '--'; end
42 if ii == 3, cint = [0,0]; lst = '-'; lw = 2.*lw; end
43 [cs,h] = contour(xax{inrow}{incol},yax{inrow}{incol},...
44 plotdata,cint,['k',lst]);
45 set(h,'linewidth',lw);
46 if UseConLabel
47 clabel(cs,h,'fontsize',fs_clabel,'rotation',0);
48 end
49 end
50 else
51 [cs,h] = contour(xax{inrow}{incol},yax{inrow}{incol},plotdata,contint);
52 set(h,'linewidth',linewidth);
53 if UseConLabel
54 clabel(cs,h,'fontsize',fs_clabel,'rotation',0);
55 end
56 end
57
58
59 % Make contour (filled) plot. Let MATLAB determine the contour
60 % intervals on a differencing plot.
61 elseif isequal(pst,'Cnf')
62 try [cs,h] = contourf(xax{inrow}{incol},yax{inrow}{incol},plotdata,contint);
63 catch [cs,h] = contourf(xax{inrow}{incol},yax{inrow}{incol},plotdata); end
64 if UseCnfLabel
65 clabel(cs,h,'fontsize',fs_clabel,'rotation',0);
66 end
67
68 % Make line plot. If this is an overlaying comparison, cycle through the
69 % appropriate data of which to overlay.
70 elseif isequal(pst,'Lin')
71 if ismember(cmp,{'OvC','OvE','OvF'})
72 for intrl = 1:ntrl
73 plot(xax{inrow}{intrl},data{inrow}{intrl},...
74 linecolors{intrl},'linewidth',linewidth);
75 end
76 else
77 plot(xax{inrow}{incol},plotdata,linecolors{1},'linewidth',linewidth);
78 end
79
80 % Unknown plot style encountered.
81 else
82 error(['Oh dear! Undefined PlotStyle: ',pst]);
83 end

  ViewVC Help
Powered by ViewVC 1.1.22