瀏覽代碼

Bugfix in-degree plots

leonboeck 6 年之前
父節點
當前提交
7288363add
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      code/ID2TLib/Statistics.py

+ 6 - 0
code/ID2TLib/Statistics.py

@@ -1141,7 +1141,10 @@ class Statistics:
                 plt.grid(True)
 
                 # plot the bar
+                labels = graphy
+                graphy = list(range(len(graphx)))
                 plt.barh(graphy, graphx, width, align='center', linewidth=1, color='red', edgecolor='red')
+                plt.yticks(graphy, labels)
                 out = self.pcap_filepath.replace('.pcap', '_in_degree' + file_ending)
                 plt.tight_layout()
                 plt.savefig(out,dpi=500)
@@ -1193,7 +1196,10 @@ class Statistics:
                 plt.grid(True)
 
                 # plot the bar
+                labels = graphy
+                graphy = list(range(len(graphx)))
                 plt.barh(graphy, graphx, width, align='center', linewidth=1, color='red', edgecolor='red')
+                plt.yticks(graphy, labels)
                 out = self.pcap_filepath.replace('.pcap', '_out_degree' + file_ending)
                 plt.tight_layout()
                 plt.savefig(out,dpi=500)