1 |
% To draw multiple vector plots |
---|
2 |
% |
---|
3 |
% Load in nod and ele files, find boundary if one does not exist locally |
---|
4 |
% if one does not exist locally it will wait until you tell it to save the bnd file or not. |
---|
5 |
[ele,x,y,z,bnd]=loadgrid('MODB'); |
---|
6 |
% |
---|
7 |
for i=1:3 |
---|
8 |
% read in v2r file |
---|
9 |
file=['resv',int2str(i),'.v2r']; |
---|
10 |
[data]=read_v2r(file); |
---|
11 |
% |
---|
12 |
%plot boundary |
---|
13 |
subplot(2,2,i),plotbnd(x,y,bnd); |
---|
14 |
% |
---|
15 |
%set window size |
---|
16 |
axis('equal'); |
---|
17 |
set(gca,'XLim',[-300000 300000]); |
---|
18 |
set(gca,'YLim',[-200000 400000]); |
---|
19 |
% |
---|
20 |
%set axis style - box around figure and no tick marks |
---|
21 |
set(gca,'Box','on'); |
---|
22 |
set(gca,'XTick',[]); |
---|
23 |
set(gca,'YTick',[]); |
---|
24 |
% plot bathymetry lines of 60 100 200 |
---|
25 |
cval=[100 200 500]; |
---|
26 |
lcontour2(ele,x,y,z,cval); |
---|
27 |
% |
---|
28 |
%Draw vectors as arrows - the 1 is the scale, so the vector scale that you |
---|
29 |
% put in with a mouse click will be 100cm/s. If you want to increase the |
---|
30 |
% size of your vectors then put in a smaller scale size( so 0.5 scale will give |
---|
31 |
% a representative scale length of 50 cm/s. |
---|
32 |
hv=vecplot2(x,y,data(:,2),data(:,3),0.10,'cm/s'); |
---|
33 |
end |
---|
34 |
% |
---|
35 |
% Print to file |
---|
36 |
orient tall |
---|
37 |
print -deps winter.eps |
---|