summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorJ08nY2017-12-28 18:54:19 +0100
committerJ08nY2017-12-28 18:54:19 +0100
commit70bcab713bcc36f3f6a5886f4651967e1585fad6 (patch)
tree267a034a146216cd4b4e0f2aa605040a1059f1f2 /util
parent552289fd86446416eefec6356659a8333d091f79 (diff)
downloadECTester-70bcab713bcc36f3f6a5886f4651967e1585fad6.tar.gz
ECTester-70bcab713bcc36f3f6a5886f4651967e1585fad6.tar.zst
ECTester-70bcab713bcc36f3f6a5886f4651967e1585fad6.zip
Diffstat (limited to 'util')
-rwxr-xr-xutil/plot_dh.py10
-rwxr-xr-xutil/plot_gen.py10
2 files changed, 18 insertions, 2 deletions
diff --git a/util/plot_dh.py b/util/plot_dh.py
index eb1886a..62a2f86 100755
--- a/util/plot_dh.py
+++ b/util/plot_dh.py
@@ -12,6 +12,7 @@
import numpy as np
import matplotlib.pyplot as plt
+import matplotlib.ticker as ticker
import argparse
from operator import itemgetter
@@ -34,9 +35,16 @@ if __name__ == "__main__":
fig.suptitle(opts.file)
axe_hist = fig.add_subplot(1,1,1)
- axe_hist.hist(time_data, bins=400, log=True)
+ time_max = max(time_data)
+ time_avg = np.average(time_data)
+ time_median = np.median(time_data)
+ axe_hist.hist(time_data, bins=time_max/3, log=True)
+ axe_hist.axvline(x=time_avg, alpha=0.7, linestyle="dotted", color="red", label="avg = {}".format(time_avg))
+ axe_hist.axvline(x=time_median, alpha=0.7, linestyle="dotted", color="green", label="median = {}".format(time_median))
axe_hist.set_ylabel("count\n(log)")
axe_hist.set_xlabel("time (ms)")
+ axe_hist.xaxis.set_major_locator(ticker.MaxNLocator())
+ axe_hist.legend(loc="best")
if opts.output is None:
plt.show()
diff --git a/util/plot_gen.py b/util/plot_gen.py
index 9c824a6..00892b5 100755
--- a/util/plot_gen.py
+++ b/util/plot_gen.py
@@ -12,6 +12,7 @@
import numpy as np
import matplotlib.pyplot as plt
+import matplotlib.ticker as ticker
from operator import itemgetter
import argparse
@@ -58,9 +59,16 @@ if __name__ == "__main__":
if plots[2]:
axe_hist = fig.add_subplot(n_plots, 1, plot_i)
- axe_hist.hist(time_data, bins=400, log=True)
+ time_max = max(time_data)
+ time_avg = np.average(time_data)
+ time_median = np.median(time_data)
+ axe_hist.hist(time_data, bins=time_max/3, log=True)
+ axe_hist.axvline(x=time_avg, alpha=0.7, linestyle="dotted", color="red", label="avg = {}".format(time_avg))
+ axe_hist.axvline(x=time_median, alpha=0.7, linestyle="dotted", color="green", label="median = {}".format(time_median))
axe_hist.set_ylabel("count\n(log)")
axe_hist.set_xlabel("time (ms)")
+ axe_hist.xaxis.set_major_locator(ticker.MaxNLocator())
+ axe_hist.legend(loc="best")
if opts.output is None:
plt.show()