From 056f7519e4772cdd4636d386a5252d9e23866729 Mon Sep 17 00:00:00 2001 From: Jonathan Rajotte Date: Fri, 26 Jul 2019 14:16:16 -0400 Subject: [PATCH] Add y scale on the right side of plot Signed-off-by: Jonathan Rajotte --- scripts/babeltrace-benchmark/benchmark.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/babeltrace-benchmark/benchmark.py b/scripts/babeltrace-benchmark/benchmark.py index 8dad781..518dce7 100644 --- a/scripts/babeltrace-benchmark/benchmark.py +++ b/scripts/babeltrace-benchmark/benchmark.py @@ -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 -- 2.34.1