From 2d8eb96be4634a6630af88fe7413d4c039480750 Mon Sep 17 00:00:00 2001 From: nikkolasg Date: Mon, 19 Aug 2019 11:55:10 +0200 Subject: [PATCH] consistents labels on graph --- simul/plots/comparison_network.py | 6 +++--- simul/plots/comparison_time.py | 9 +++++---- simul/plots/failing_time.py | 7 ++++--- simul/plots/reallike.py | 6 +++--- simul/plots/sigchecked.py | 10 +++++----- 5 files changed, 20 insertions(+), 18 deletions(-) diff --git a/simul/plots/comparison_network.py b/simul/plots/comparison_network.py index 135c30b..4a425db 100755 --- a/simul/plots/comparison_network.py +++ b/simul/plots/comparison_network.py @@ -15,12 +15,12 @@ ## mapping between files and label # "csv/libp2p_2000_51thr_agg1.csv": "libp2p"} files = {"csv/handel_0failing_99thr.csv": { - "label": "handel", + "label": "Handel", "xOffset": 0.10, "yOffset": 0.09, }, "csv/n2_4000_99thr.csv": { - "label": "complete", + "label": "Complete", "xOffset": 0.20, "yOffset": -0.04, } @@ -53,7 +53,7 @@ plt.legend(fontsize=fs_label) plt.ylabel("KBytes (log)",fontsize=fs_label) -plt.xlabel("Handel nodes",fontsize=fs_label) +plt.xlabel("Number of Handel nodes",fontsize=fs_label) # plt.title("Outgoing network consumption - comparative baseline",fontsize=fs_label) plt.yscale('log') plt.show() diff --git a/simul/plots/comparison_time.py b/simul/plots/comparison_time.py index 0beac15..f641341 100755 --- a/simul/plots/comparison_time.py +++ b/simul/plots/comparison_time.py @@ -14,12 +14,12 @@ # files = sys.argv[1:] ## mapping between files and label files = {"csv/handel_0failing_99thr.csv": { - "label": "handel", + "label": "Handel", "xOffset": 0.10, "yOffset": 0.14, }, "csv/n2_4000_99thr.csv": { - "label": "complete", + "label": "Complete", "xOffset": 0.17, "yOffset": -0.02, } @@ -51,8 +51,9 @@ plt.legend(fontsize=fs_label) -plt.ylabel("signature generation (ms)",fontsize=fs_label) -plt.xlabel("Handel nodes",fontsize=fs_label) +plt.ylabel("Signature generation (ms)",fontsize=fs_label) +plt.xlabel("Number of Handel nodes",fontsize=fs_label) # plt.title("Signature generation time - comparative baseline",fontsize=fs_label) # plt.yscale('log') +# plt.tight_layout() plt.show() diff --git a/simul/plots/failing_time.py b/simul/plots/failing_time.py index 18841e9..f76fb36 100755 --- a/simul/plots/failing_time.py +++ b/simul/plots/failing_time.py @@ -39,7 +39,8 @@ x = v[failingColumn].map(lambda x: int((x/nodes) * 100)) for c,name in yColumns.items(): - y = v[c] + # y = v[c] + y = v[c].map(lambda x: x * 1000) print("file %s -> %d data points on %s" % (f,len(y),sigColumn)) # label = files[f] label = name @@ -50,8 +51,8 @@ label= 35 plt.legend(fontsize=label) -plt.ylabel("signature generation",fontsize=label) -plt.xlabel("failing nodes in %",fontsize=label) +plt.ylabel("Signature generation (ms)",fontsize=label) +plt.xlabel("Failing nodes in %",fontsize=label) # plt.yscale('log') # plt.title("Time for 51% signature threshold over 4000 nodes") # plt.axis('log') diff --git a/simul/plots/reallike.py b/simul/plots/reallike.py index 03356ea..48d7535 100755 --- a/simul/plots/reallike.py +++ b/simul/plots/reallike.py @@ -27,7 +27,7 @@ y = v[column].map(lambda x: x*1000) print("file %s -> %d data points on %s" % (f,len(y),column)) # label = files[c] - label = "handel" + label = "Handel" if label == "": label = input("Label for file %s: " % f) @@ -40,9 +40,9 @@ # plot(x,y,"-","linear",allColors.popleft()) plt.legend(fontsize=fs_label) -plt.ylabel("signature generation (ms)",fontsize=fs_label) +plt.ylabel("Signature generation (ms)",fontsize=fs_label) # plt.ylabel("sig queue size",fontsize=fs_label) -plt.xlabel("nodes",fontsize=fs_label) +plt.xlabel("Number of nodes",fontsize=fs_label) plt.title("Handel: 75% threshold signature with 25% failings",fontsize=fs_label) # plt.yscale('log') plt.show() diff --git a/simul/plots/sigchecked.py b/simul/plots/sigchecked.py index 453387e..73933e5 100755 --- a/simul/plots/sigchecked.py +++ b/simul/plots/sigchecked.py @@ -9,9 +9,9 @@ import pandas as pd import matplotlib.pyplot as plt -columns = {"sigs_sigCheckedCt_avg": "average", - "sigs_sigCheckedCt_min": "minimum", - "sigs_sigCheckedCt_max": "maximum"} +columns = {"sigs_sigCheckedCt_avg": "Average", + "sigs_sigCheckedCt_min": "Minimum", + "sigs_sigCheckedCt_max": "Maximum"} files = {"csv/handel_0failing_99thr.csv": "handel"} datas = read_datafiles(files) @@ -29,8 +29,8 @@ plot(x,y,"-",label,allColors.popleft()) plt.legend(fontsize=fs_label) -plt.ylabel("signatures checked",fontsize=fs_label) -plt.xlabel("nodes",fontsize=fs_label) +plt.ylabel("Number of signatures",fontsize=fs_label) +plt.xlabel("Number of nodes",fontsize=fs_label) # plt.title("Number of signatures checked",fontsize=fs_label) # plt.yscale('log') plt.show()