|
@@ -1060,7 +1060,7 @@ class Statistics:
|
|
graphy = list(range(len(graphx)))
|
|
graphy = list(range(len(graphx)))
|
|
plt.barh(graphy, graphx, width, align='center', linewidth=1, color='red', edgecolor='red')
|
|
plt.barh(graphy, graphx, width, align='center', linewidth=1, color='red', edgecolor='red')
|
|
plt.yticks(graphy, labels)
|
|
plt.yticks(graphy, labels)
|
|
- out = self.pcap_filepath.replace('.pcap', '_in_degree' + file_ending)
|
|
|
|
|
|
+ out = self.pcap_filepath.replace('.pcap', '_plot-In Degree of an IP' + file_ending)
|
|
plt.tight_layout()
|
|
plt.tight_layout()
|
|
plt.savefig(out,dpi=500)
|
|
plt.savefig(out,dpi=500)
|
|
|
|
|
|
@@ -1113,7 +1113,7 @@ class Statistics:
|
|
graphy = list(range(len(graphx)))
|
|
graphy = list(range(len(graphx)))
|
|
plt.barh(graphy, graphx, width, align='center', linewidth=1, color='red', edgecolor='red')
|
|
plt.barh(graphy, graphx, width, align='center', linewidth=1, color='red', edgecolor='red')
|
|
plt.yticks(graphy, labels)
|
|
plt.yticks(graphy, labels)
|
|
- out = self.pcap_filepath.replace('.pcap', '_out_degree' + file_ending)
|
|
|
|
|
|
+ out = self.pcap_filepath.replace('.pcap', '_plot-Out Degree of an IP' + file_ending)
|
|
plt.tight_layout()
|
|
plt.tight_layout()
|
|
plt.savefig(out,dpi=500)
|
|
plt.savefig(out,dpi=500)
|
|
|
|
|
|
@@ -1166,7 +1166,7 @@ class Statistics:
|
|
graphy = list(range(len(graphx)))
|
|
graphy = list(range(len(graphx)))
|
|
plt.barh(graphy, graphx, width, align='center', linewidth=1, color='red', edgecolor='red')
|
|
plt.barh(graphy, graphx, width, align='center', linewidth=1, color='red', edgecolor='red')
|
|
plt.yticks(graphy, labels)
|
|
plt.yticks(graphy, labels)
|
|
- out = self.pcap_filepath.replace('.pcap', '_overall_degree' + file_ending)
|
|
|
|
|
|
+ out = self.pcap_filepath.replace('.pcap', '_plot-Overall Degree of an IP' + file_ending)
|
|
plt.tight_layout()
|
|
plt.tight_layout()
|
|
plt.savefig(out,dpi=500)
|
|
plt.savefig(out,dpi=500)
|
|
return out
|
|
return out
|
|
@@ -1363,7 +1363,7 @@ class Statistics:
|
|
|
|
|
|
# set additional plot parameters
|
|
# set additional plot parameters
|
|
plt.title(title)
|
|
plt.title(title)
|
|
- plt.ylabel("Number of connections")
|
|
|
|
|
|
+ plt.ylabel("Relative frequency of connections")
|
|
plt.xlabel(label)
|
|
plt.xlabel(label)
|
|
width = 0.5
|
|
width = 0.5
|
|
plt.grid(True)
|
|
plt.grid(True)
|
|
@@ -1374,11 +1374,11 @@ class Statistics:
|
|
for i in range(0, 11):
|
|
for i in range(0, 11):
|
|
bins.append(i * max_val/10)
|
|
bins.append(i * max_val/10)
|
|
|
|
|
|
- # comment out and set weights to normalize
|
|
|
|
- # weights = numpy.ones_like(result)/float(len(result))
|
|
|
|
|
|
+ # set weights normalize histogram
|
|
|
|
+ weights = numpy.ones_like(result)/float(len(result))
|
|
|
|
|
|
# plot the above data, first use plain numbers as graphy to maintain sorting
|
|
# plot the above data, first use plain numbers as graphy to maintain sorting
|
|
- plt.hist(result, bins=bins, color='red', edgecolor='red', align="mid", rwidth=0.5)
|
|
|
|
|
|
+ plt.hist(result, bins=bins, weights=weights, color='red', edgecolor='red', align="mid", rwidth=0.5)
|
|
plt.xticks(bins)
|
|
plt.xticks(bins)
|
|
|
|
|
|
# save created figure
|
|
# save created figure
|
|
@@ -1409,7 +1409,7 @@ class Statistics:
|
|
|
|
|
|
# set additional plot parameters
|
|
# set additional plot parameters
|
|
plt.title(title)
|
|
plt.title(title)
|
|
- plt.ylabel("Number of IPs")
|
|
|
|
|
|
+ plt.ylabel("Relative frequency of IPs")
|
|
plt.xlabel(label)
|
|
plt.xlabel(label)
|
|
width = 0.5
|
|
width = 0.5
|
|
plt.grid(True)
|
|
plt.grid(True)
|
|
@@ -1420,11 +1420,11 @@ class Statistics:
|
|
for i in range(0, 11):
|
|
for i in range(0, 11):
|
|
bins.append(int(i * max_val/10))
|
|
bins.append(int(i * max_val/10))
|
|
|
|
|
|
- # comment out and set weights to normalize
|
|
|
|
- # weights = numpy.ones_like(result)/float(len(result))
|
|
|
|
|
|
+ # set weights normalize histogram
|
|
|
|
+ weights = numpy.ones_like(result)/float(len(result))
|
|
|
|
|
|
# plot the above data, first use plain numbers as graphy to maintain sorting
|
|
# plot the above data, first use plain numbers as graphy to maintain sorting
|
|
- plt.hist(result, bins=bins, color='red', edgecolor='red', align="mid", rwidth=0.5)
|
|
|
|
|
|
+ plt.hist(result, bins=bins, weights=weights, color='red', edgecolor='red', align="mid", rwidth=0.5)
|
|
plt.xticks(bins)
|
|
plt.xticks(bins)
|
|
|
|
|
|
# save created figure
|
|
# save created figure
|