forked from sgarbarino/mechanistic-profiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtermain.m
161 lines (148 loc) · 5.3 KB
/
termain.m
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
% Main file for ternary plot
% close all;clear all
% warning off MATLAB:griddata:DuplicateDataPoints
% Load the data for limestone
% File format: 1. column: solid volume fraction
% 2. column: water volume fraction
% 3. column: gas volume fraction
% 4. column: effective dielectric permittivity
% The data matrix is called A
% To obtain the velocities (in m/ns): v=0.29./sqrt(A(:,4));
%
load limestone
% Add the 'corner' values (looks better in the surface plot)
l=length(A);
A(l+1,:)=[1 0 0 6];
A(l+2,:)=[0 1 0 30];
A(l+3,:)=[0 0 1 1];
% ... and the GPR velocity
v=0.29./sqrt(A(:,4));
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% EXAMPLE CODE FOR THE PSEUDO COLOR PLOT
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
figure;
% Plot the data
% First set the colormap (can't be done afterwards)
colormap(jet)
[hg,htick,hcb]=tersurf(A(:,1),A(:,2),A(:,3),v);
% Add the labels
hlabels=terlabel('Limestone','Water','Air');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% The following modifications are not serious, just to illustrate how to
% use the handles:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%-- Change the color of the grid lines
set(hg(:,3),'color','m')
set(hg(:,2),'color','c')
set(hg(:,1),'color','y')
%-- Modify the labels
set(hlabels,'fontsize',12)
set(hlabels(3),'color','m')
set(hlabels(2),'color','c')
set(hlabels(1),'color','y')
%-- Modify the tick labels
set(htick(:,1),'color','y','linewidth',3)
set(htick(:,2),'color','c','linewidth',3)
set(htick(:,3),'color','m','linewidth',3)
%-- Change the colorbar
set(hcb,'xcolor','w','ycolor','w')
%-- Modify the figure color
set(gcf,'color',[0 0 0.3])
%-- Change some defaults
set(gcf,'paperpositionmode','auto','inverthardcopy','off')
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% EXAMPLE CODE FOR THE CONTOUR PLOT
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
figure
% Plot the ternary axis system
[h,hg,htick]=terplot;
% Plot the data
% First set the colormap (can't be done afterwards)
colormap(jet)
[hcont,ccont,hcb]=tercontour(A(:,1),A(:,2),A(:,3),v,linspace(min(v),max(v),10));
clabel(ccont,hcont);
set(hcont,'linewidth',2)
% Add the labels
hlabels=terlabel('Limestone','Water','Air');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% The following modifications are not serious, just to illustrate how to
% use the handles:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%-- Change the color of the grid lines
set(hg(:,3),'color','m')
set(hg(:,2),'color','c')
set(hg(:,1),'color','y')
%-- Modify the labels
set(hlabels,'fontsize',12)
set(hlabels(3),'color','m')
set(hlabels(2),'color','c')
set(hlabels(1),'color','y')
%-- Modify the tick labels
set(htick(:,1),'color','y','linewidth',3)
set(htick(:,2),'color','c','linewidth',3)
set(htick(:,3),'color','m','linewidth',3)
%-- Change the color of the patch
set(h,'facecolor',[0.7 0.7 0.7],'edgecolor','w')
%-- Change the colorbar
set(hcb,'xcolor','w','ycolor','w')
%-- Modify the figure color
set(gcf,'color',[0 0 0.3])
%-- Change some defaults
set(gcf,'paperpositionmode','auto','inverthardcopy','off')
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% EXAMPLE CODE FOR THE COLOR TERNARY PLOT
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
figure
% Plot the ternary axis system
[h,hg,htick]=terplot;
% Plot the data
% First set the colormap (can't be done afterwards)
colormap(jet)
[hd,hcb]=ternaryc(A(:,1),A(:,2),A(:,3),v,'o');
% Add the labels
hlabels=terlabel('Limestone','Water','Air');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% The following modifications are not serious, just to illustrate how to
% use the handles:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%-- Change the color of the grid lines
set(hg(:,3),'color','m')
set(hg(:,2),'color','c')
set(hg(:,1),'color','y')
%-- Change the marker size
set(hd,'markersize',3)
%-- Modify the labels
set(hlabels,'fontsize',12)
set(hlabels(3),'color','m')
set(hlabels(2),'color','c')
set(hlabels(1),'color','y')
%-- Modify the tick labels
set(htick(:,1),'color','y','linewidth',3)
set(htick(:,2),'color','c','linewidth',3)
set(htick(:,3),'color','m','linewidth',3)
%-- Change the color of the patch
set(h,'facecolor',[0.7 0.7 0.7],'edgecolor','w')
%-- Change the colorbar
set(hcb,'xcolor','w','ycolor','w')
%-- Modify the figure color
set(gcf,'color',[0 0 0.3])
%-- Change some defaults
set(gcf,'paperpositionmode','auto','inverthardcopy','off')
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Lastly, an example showing the "constant data option" of
% ternaryc().
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
figure
%-- Plot the axis system
[h,hg,htick]=terplot;
%-- Plot the data ...
hter=ternaryc(A(:,1),A(:,2),A(:,3));
%-- ... and modify the symbol:
set(hter,'marker','o','markerfacecolor','none','markersize',4)
hlabels=terlabel('C1','C2','C3');