NCCOOS Trac Projects: Top | Web | Platforms | Processing | Viz | Sprints | Sandbox | (Wind)

root/gliderproc/trunk/MATLAB/opnml/FCAST_1.2/matlab_cen/plot_s2r.m

Revision 495 (checked in by cbc, 12 years ago)

Initial import of Stark code.

Line 
1 newplot='y';
2 while newplot == 'y',
3 %
4 % Load data from files
5 %
6    ls *.s2r
7    filename=input('Enter the name of .s2r file: ','s');
8    [s2r,gridname]=read_s2r(filename);
9    scalar=s2r(:,2);
10    gridname=blank(gridname(1:length(gridname)-1));
11    [in,x,y,z,bnd]=loadgrid(gridname);
12 %
13 % Plot boundary
14 %
15    figure
16    whitebg('w')
17    hold on
18    bndo=plotbnd(x,y,bnd);
19    set(bndo,'Color','k')
20    axis('equal')
21 %   cval=[50 100 200];
22 %   hc=lcontour2(ele,x,y,z,cval);
23 %   set(hc,'Color','k')
24 %
25 % Set contour levels and make plot
26 %
27    newcont='y';
28    while newcont == 'y',
29       title([filename])
30       scrange(scalar)
31       cint=input('Enter the contour interval: ');
32       cmin=cint*ceil(min(scalar)/cint);
33       cmax=cint*floor(max(scalar)/cint);
34       clear cval
35       i=1;
36       cval(i)=cmin;
37       while cval(i) < cmax
38          i=i+1;
39          cval(i)=cval(i-1)+cint;
40       end
41       cval
42       hc=lcontour2(in,x,y,scalar,cval);
43       title([filename,': ',num2str(cmin),' to ',num2str(cmax),' by ',num2str(cint)])   
44       zoom on
45       newcont=input('New contour interval? (y/n): ','s');
46       if newcont == 'y',
47          delete(hc);
48       end
49    end
50    newplot=input('New plot? (y/n): ','s');
51 end
Note: See TracBrowser for help on using the browser.