-
Notifications
You must be signed in to change notification settings - Fork 0
/
Plot_Cumulative_Probabilities_wBetweenness.m
executable file
·206 lines (205 loc) · 5.81 KB
/
Plot_Cumulative_Probabilities_wBetweenness.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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
% First run "Plot_Universal_Params_wBetweenness.m",
% to obtain total nodes for each year.
% Then run this script
% clear
close all
format long
clc
set(0,'DefaultLineLineWidth',1.5)
set(0,'DefaultaxesLineWidth',1.5)
set(0,'DefaultaxesFontSize',15)
%
%%%%%%%%%%%%%%%%%%%% Read
fileName='Domestic/Results/1996_wBetweenness/Cumulative_Probabilities_Betweenness.dat' ;
FID=fopen(fileName,'r');
char1 = fscanf(FID,'%s',3);
for i=1:184
B1996(i)=fscanf(FID,'%e ',1);
pB1996(i)=fscanf(FID,'%e \n',1);
end
fclose(FID);
%
fileName='Domestic/Results/1997_wBetweenness/Cumulative_Probabilities_Betweenness.dat' ;
FID=fopen(fileName,'r');
char1 = fscanf(FID,'%s',3);
for i=1:165
B1997(i)=fscanf(FID,'%e ',1);
pB1997(i)=fscanf(FID,'%e \n',1);
end
%
fileName='Domestic/Results/1998_wBetweenness/Cumulative_Probabilities_Betweenness.dat' ;
FID=fopen(fileName,'r');
char1 = fscanf(FID,'%s',3);
for i=1:178
B1998(i)=fscanf(FID,'%e ',1);
pB1998(i)=fscanf(FID,'%e \n',1);
end
%
fileName='Domestic/Results/1999_wBetweenness/Cumulative_Probabilities_Betweenness.dat' ;
FID=fopen(fileName,'r');
char1 = fscanf(FID,'%s',3);
for i=1:183
B1999(i)=fscanf(FID,'%e ',1);
pB1999(i)=fscanf(FID,'%e \n',1);
end
%
fileName='Domestic/Results/2000_wBetweenness/Cumulative_Probabilities_Betweenness.dat' ;
FID=fopen(fileName,'r');
char1 = fscanf(FID,'%s',3);
for i=1:204
B2000(i)=fscanf(FID,'%e ',1);
pB2000(i)=fscanf(FID,'%e \n',1);
end
%
fileName='Domestic/Results/2001_wBetweenness/Cumulative_Probabilities_Betweenness.dat' ;
FID=fopen(fileName,'r');
char1 = fscanf(FID,'%s',3);
for i=1:219
B2001(i)=fscanf(FID,'%e ',1);
pB2001(i)=fscanf(FID,'%e \n',1);
end
%
fileName='Domestic/Results/2002_wBetweenness/Cumulative_Probabilities_Betweenness.dat' ;
FID=fopen(fileName,'r');
char1 = fscanf(FID,'%s',3);
for i=1:379
B2002(i)=fscanf(FID,'%e ',1);
pB2002(i)=fscanf(FID,'%e \n',1);
end
%
fileName='Domestic/Results/2003_wBetweenness/Cumulative_Probabilities_Betweenness.dat' ;
FID=fopen(fileName,'r');
char1 = fscanf(FID,'%s',3);
for i=1:409
B2003(i)=fscanf(FID,'%e ',1);
pB2003(i)=fscanf(FID,'%e \n',1);
end
%
fileName='Domestic/Results/2004_wBetweenness/Cumulative_Probabilities_Betweenness.dat' ;
FID=fopen(fileName,'r');
char1 = fscanf(FID,'%s',3);
for i=1:431
B2004(i)=fscanf(FID,'%e ',1);
pB2004(i)=fscanf(FID,'%e \n',1);
end
%
fileName='Domestic/Results/2005_wBetweenness/Cumulative_Probabilities_Betweenness.dat' ;
FID=fopen(fileName,'r');
char1 = fscanf(FID,'%s',3);
for i=1:441
B2005(i)=fscanf(FID,'%e ',1);
pB2005(i)=fscanf(FID,'%e \n',1);
end
%
fileName='Domestic/Results/2006_wBetweenness/Cumulative_Probabilities_Betweenness.dat' ;
FID=fopen(fileName,'r');
char1 = fscanf(FID,'%s',3);
for i=1:444
B2006(i)=fscanf(FID,'%e ',1);
pB2006(i)=fscanf(FID,'%e \n',1);
end
%
fileName='Domestic/Results/2007_wBetweenness/Cumulative_Probabilities_Betweenness.dat' ;
FID=fopen(fileName,'r');
char1 = fscanf(FID,'%s',3);
for i=1:433
B2007(i)=fscanf(FID,'%e ',1);
pB2007(i)=fscanf(FID,'%e \n',1);
end
%
fileName='Domestic/Results/2008_wBetweenness/Cumulative_Probabilities_Betweenness.dat' ;
FID=fopen(fileName,'r');
char1 = fscanf(FID,'%s',3);
for i=1:444
B2008(i)=fscanf(FID,'%e ',1);
pB2008(i)=fscanf(FID,'%e \n',1);
end
%
fileName='Domestic/Results/2009_wBetweenness/Cumulative_Probabilities_Betweenness.dat' ;
FID=fopen(fileName,'r');
char1 = fscanf(FID,'%s',3);
for i=1:443
B2009(i)=fscanf(FID,'%e ',1);
pB2009(i)=fscanf(FID,'%e \n',1);
end
%
fileName='Domestic/Results/2010_wBetweenness/Cumulative_Probabilities_Betweenness.dat' ;
FID=fopen(fileName,'r');
char1 = fscanf(FID,'%s',3);
for i=1:437
B2010(i)=fscanf(FID,'%e ',1);
pB2010(i)=fscanf(FID,'%e \n',1);
end
%
fileName='Domestic/Results/2011_wBetweenness/Cumulative_Probabilities_Betweenness.dat' ;
FID=fopen(fileName,'r');
char1 = fscanf(FID,'%s',3);
for i=1:433
B2011(i)=fscanf(FID,'%e ',1);
pB2011(i)=fscanf(FID,'%e \n',1);
end
%
fileName='Domestic/Results/2012_wBetweenness/Cumulative_Probabilities_Betweenness.dat' ;
FID=fopen(fileName,'r');
char1 = fscanf(FID,'%s',3);
for i=1:400
B2012(i)=fscanf(FID,'%e ',1);
pB2012(i)=fscanf(FID,'%e \n',1);
end
%
fileName='Domestic/Results/2013_wBetweenness/Cumulative_Probabilities_Betweenness.dat' ;
FID=fopen(fileName,'r');
char1 = fscanf(FID,'%s',3);
for i=1:397
B2013(i)=fscanf(FID,'%e ',1);
pB2013(i)=fscanf(FID,'%e \n',1);
end
%
fileName='Domestic/Results/2014_wBetweenness/Cumulative_Probabilities_Betweenness.dat' ;
FID=fopen(fileName,'r');
char1 = fscanf(FID,'%s',3);
for i=1:398
B2014(i)=fscanf(FID,'%e ',1);
pB2014(i)=fscanf(FID,'%e \n',1);
end
%
fileName='Domestic/Results/2015_wBetweenness/Cumulative_Probabilities_Betweenness.dat' ;
FID=fopen(fileName,'r');
char1 = fscanf(FID,'%s',3);
for i=1:389
B2015(i)=fscanf(FID,'%e ',1);
pB2015(i)=fscanf(FID,'%e \n',1);
end
%
fileName='Domestic/Results/2016_wBetweenness/Cumulative_Probabilities_Betweenness.dat' ;
FID=fopen(fileName,'r');
char1 = fscanf(FID,'%s',3);
for i=1:411
B2016(i)=fscanf(FID,'%e ',1);
pB2016(i)=fscanf(FID,'%e \n',1);
end
%
AIR=AIRin;
B1996=B1996/(AIR(1)-1)/(AIR(1)-2);
B2001=B2001/(AIR(6)-1)/(AIR(6)-2);
B2006=B2006/(AIR(11)-1)/(AIR(11)-2);
B2011=B2011/(AIR(16)-1)/(AIR(16)-2);
B2016=B2016/(AIR(21)-1)/(AIR(12)-2);
%%%%%%%%%%%%%%%%%%%% Plot
% Plot Betweenness
figure
loglog(B1996,pB1996,'dk','MarkerFaceColor','w')
hold on
loglog(B2001,pB2001,'om','MarkerFaceColor','m')
hold on
loglog(B2006,pB2006,'vb','MarkerFaceColor','b')
hold on
loglog(B2011,pB2011,'sr','MarkerFaceColor','r')
hold on
loglog(B2016,pB2016,'dk','MarkerFaceColor','k')
axis([1e-07 1e-0 1e-03 2])
ylabel('\it{P}\rm{(}\it{B}\rm{)}')
xlabel('\it{B}')
legend('1996','2001','2006','2011','2016','Location','Southwest')
print(gcf, '-dpng', 'Cumul_Distribution_Betweenness.png');
%