Add y scale on the right side of plot
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Fri, 26 Jul 2019 18:16:16 +0000 (14:16 -0400)
committerJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Fri, 26 Jul 2019 18:16:16 +0000 (14:16 -0400)
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
scripts/babeltrace-benchmark/benchmark.py

index 8dad78191057007cacd20c399c03123228f19f23..518dce70ab117c0286ecfeb5fb53be5ffed02750 100644 (file)
@@ -179,6 +179,7 @@ def plot_raw_value(branch, benchmark_type, x_data, y_data, labels, latest_values
         )
         if l_result >= ymax:
             ymax = 1.2 * l_result
+    ax = plt.gca()
     plt.ylim(ymin=0, ymax=ymax)
     plt.xticks(x_data, labels, rotation=90, family="monospace")
     plt.title(graph_get_title(branch, benchmark_type), fontweight="bold")
@@ -186,6 +187,9 @@ def plot_raw_value(branch, benchmark_type, x_data, y_data, labels, latest_values
     plt.xlabel("Latest commits")
     plt.legend()
 
+    # Put tick on the right side
+    ax.tick_params(labeltop=False, labelright=True)
+
     plt.tight_layout()
     return
 
@@ -243,10 +247,12 @@ def plot_ratio(branch, benchmark_type, x_data, y_data, labels, latest_values):
     plt.xlabel("Latest commits")
     plt.legend()
 
+    # Put tick on the right side
+    ax.tick_params(labeltop=False, labelright=True)
+
     plt.tight_layout()
     return
 
-
 def generate_graph(branches, report_name, git_path):
 
     # The PDF document
This page took 0.023354 seconds and 4 git commands to generate.