-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSM_Plot3d_comp.m
More file actions
132 lines (100 loc) · 2.76 KB
/
SM_Plot3d_comp.m
File metadata and controls
132 lines (100 loc) · 2.76 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
function fign=SM_Plot3d_comp(GX,GY,GZ,GV,xslice,yslice,zslice,printname)
% PLOT3D Creates 3d slice plot of gridded data
% [H] = SM_PLOT3D(X,Y,Z,GRD,XSLICE,YSLICE,ZSLICE)
%
% Creates 3d slice plot of gridded data, xslice, yslice, and zslice
% are x, y, and z coordinates for a slice. For multiple slices along
% one axis input use xlice = [x1 x2].
%
% Created by Alan Baird on 2012-02-06.
% Copyright (c) . All rights reserved.
%hAx(1) = subplot(2,3,[1 2]); h = slice(GX,GY,GZ,GV,xslice,yslice,zslice); view([37.5 25]);
%hAx(2) = subplot(2,3,3); copyobj(h,hAx(2)); view(0,90)
%hAx(3) = subplot(2,3,[4 5]); copyobj(h,hAx(3)); view(90,0)
%hAx(4) = subplot(2,3,6); copyobj(h,hAx(4)); view(0,0)
[ylen,xlen,zlen]=size(GX);
yyx=(0.7*ylen)/(ylen+xlen);
xyx=(0.7*xlen)/(ylen+xlen);
zzy=(0.7*zlen)/(zlen+ylen);
yzy=(0.7*ylen)/(zlen+ylen);
aratio=(ylen+xlen)/(zlen+ylen)
height=1.0/aratio;
width=1.0;
scale=1000;
xpos=50;
ypos=500;
fign=figure;
set(gcf,'Position',[xpos ypos scale*width scale*height]) % Set figure format
hAx(1) = subplot('Position',[0.1 (0.1+zzy+0.1) yyx yzy]); h = slice(GX,GY,GZ,GV,xslice,yslice,zslice); view([37.5 25]);
colorbar('location','southoutside')
hAx(2) = subplot('Position',[(0.1+yyx+0.1) (0.1+zzy+0.1) xyx yzy]); copyobj(h,hAx(2)); view(0,90)
hAx(3) = subplot('Position',[0.1 0.1 yyx zzy]); copyobj(h,hAx(3)); view(90,0)
hAx(4) = subplot('Position',[(0.1+yyx+0.1) 0.1 xyx zzy]); copyobj(h,hAx(4)); view(0,0)
%hAx(1) = subaxis(2,2,1); h = slice(GX,GY,GZ,GV,xslice,yslice,zslice); view([37.5 25]);
%hAx(2) = subaxis(2,2,2); copyobj(h,hAx(2)); view(90,90)
%hAx(3) = subaxis(2,2,3); copyobj(h,hAx(3)); view(0,0)
%hAx(4) = subaxis(2,2,4); copyobj(h,hAx(4)); view(90,0)
for i=1:4
axis(hAx(i), 'on')
grid(hAx(i), 'off')
axis(hAx(i), 'equal')
axis(hAx(i), 'tight')
shading(hAx(i), 'interp')
end
if nargin==8
hgexport(gcf, printname, ...
hgexport('factorystyle'), 'Format', 'epsc');
end
%set(gcf, 'PaperUnits','inches');
%set(gcf, 'PaperSize', [(8/aratio) 20]);
%
%linkaxes(hAx,'x')
%hc = colorbar('Peer',hAx(1));
%
%h=figure;
%subplot(2,2,2);
%slice(GX,GY,GZ,GV,xslice,yslice,zslice);
%%view(3);
%view([37.5 25]);
%axis on;
%grid on;
%%light;
%%lighting phong;
%%camlight('left');
%shading interp;
%axis tight;
%axis equal;
%
%subplot(2,2,1);
%slice(GX,GY,GZ,GV,xslice,yslice,zslice);
%%view(3);
%axis on;
%grid on;
%shading interp;
%axis tight;
%axis equal;
%view([0 90]);
%
%subplot(2,2,3);
%slice(GX,GY,GZ,GV,xslice,yslice,zslice);
%%view(3);
%axis on;
%grid on;
%shading interp;
%axis tight;
%axis equal;
%view([0 0]);
%
%subplot(2,2,4);
%slice(GX,GY,GZ,GV,xslice,yslice,zslice);
%%view(3);
%axis on;
%grid on;
%shading interp;
%axis tight;
%axis equal;
%view([90 0]);
%
%c=colorbar;
%set(c,'Position',[0.05 0.1 0.05 0.5]);
end % function