aboutsummaryrefslogtreecommitdiff
path: root/util/plot_dh.py
diff options
context:
space:
mode:
authorJ08nY2018-03-28 14:30:08 +0200
committerJ08nY2018-03-28 14:30:08 +0200
commite2b6a298522e6206903dcd0a0455431fb647d5d4 (patch)
tree09ed2b071b88de58f73e3d4288f43c8eabd01bfe /util/plot_dh.py
parent054f9f61f59a7b20ba835abb98d57a9746cafa86 (diff)
downloadECTester-e2b6a298522e6206903dcd0a0455431fb647d5d4.tar.gz
ECTester-e2b6a298522e6206903dcd0a0455431fb647d5d4.tar.zst
ECTester-e2b6a298522e6206903dcd0a0455431fb647d5d4.zip
Diffstat (limited to 'util/plot_dh.py')
-rwxr-xr-xutil/plot_dh.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/util/plot_dh.py b/util/plot_dh.py
index 55e11b3..33fc3eb 100755
--- a/util/plot_dh.py
+++ b/util/plot_dh.py
@@ -22,6 +22,7 @@ if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Plot ECTester ECDH timing.")
parser.add_argument("-o", "--output", dest="output", type=argparse.FileType("wb"), help="Write image to [file], do not display.", metavar="file")
parser.add_argument("--skip-first", dest="skip_first", action="store_true", help="Skip first entry, as it's usually a large outlier.")
+ parser.add_argument("-t", "--title", dest="title", nargs="?", default="", type=str, help="What title to give the figure.")
parser.add_argument("file", type=str, help="The file to plot(csv).")
opts = parser.parse_args()
@@ -48,8 +49,14 @@ if __name__ == "__main__":
plt.style.use("ggplot")
fig = plt.figure()
- fig.tight_layout(rect=[0, 0.02, 1, 0.98])
- fig.suptitle(opts.file)
+ layout_kwargs = {}
+ if opts.title is None:
+ fig.suptitle(opts.file)
+ layout_kwargs["rect"] = [0, 0.02, 1, 0.98]
+ elif opts.title:
+ fig.suptitle(opts.title)
+ layout_kwargs["rect"] = [0, 0.02, 1, 0.98]
+ fig.tight_layout(**layout_kwargs)
axe_hist = fig.add_subplot(2,1,1)
time_max = max(time_data)