-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathplot_faultseg.m
More file actions
59 lines (42 loc) · 1.18 KB
/
plot_faultseg.m
File metadata and controls
59 lines (42 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
%This script is used to plot the seafloor deformation file, deform_segXX.dat, by COMCOT
%The Script is designed to plot output of multiple fault planes
%The Script only works for COMCOT version1.7
%Last Revise: DEC30 2008 by Xiaoming Wang
function plot_faultseg(id)
layer = load('layer01.dat');
layer_x = load('layer01_x.dat');
layer_y = load('layer01_y.dat');
[x,y] = meshgrid(layer_x,layer_y);
nx = length(layer_x);
ny = length(layer_y);
depth = reshape(layer,nx,ny);
clear layer
clear layer_x
clear layer_y
if id<10
id_str = ['0', num2str(id)];
else
id_str = num2str(id);
end
filename = ['deform_seg',id_str];
fid = fopen([filename,'.dat']);
a = fscanf(fid,'%g',inf); % write all data into a column of matrix a.
fclose(fid);
deform = reshape(a,nx,ny);
clear a
zmax = max(max(deform))
zmin = min(min(deform))
cmax = 0.95*max([abs(zmax) abs(zmin)])
pcolor(x,y,deform')
shading interp
axis equal
axis tight
caxis([-cmax cmax])
colorbar
xlabel('X Coordinate')
ylabel('Y Coordinate')
clear deform
hold on
contour(x,y,-depth',[0 0],'k')
figurename = ['Figure_SeafloorDsiplacement_','Seg',id_str];
print(gcf,'-dpng', figurename);