commit 48a2d06dc7b9dbde36d3979a019457b3d6fc188d
Author:     Mattias Andrée <[email protected]>
AuthorDate: Mon May 2 15:47:33 2016 +0200
Commit:     Mattias Andrée <[email protected]>
CommitDate: Mon May 2 15:47:33 2016 +0200

    plot: adjust y-axis
    
    Signed-off-by: Mattias Andrée <[email protected]>

diff --git a/bench/plot.py b/bench/plot.py
index ff089c3..91b33f9 100755
--- a/bench/plot.py
+++ b/bench/plot.py
@@ -86,6 +86,9 @@ ypoints = [ypoints[i[0]] for (i, _) in merged]
 values  = [values[i[0]]  for (i, _) in merged]
 labels  = [' & '.join(labels[j] for j in i)  for (i, _) in merged]
 
+vmin = min(min(min(v) for v in values), 0)
+vmax = max(max(max(v) for v in values), 0)
+
 if dim == 1:
     plot.ylabel('time')
     if len(values[0]) == 1:
@@ -123,6 +126,8 @@ elif dim == 2:
 elif dim == 3:
     pass
 
+plot.ylim((vmin * 1.1, vmax * 1.1))
+
 if not xkcdstyle:
     plot.grid(True)
 plot.show()

Reply via email to