From a3f0278074004dd173cbac69fe4286b5ee02dbba Mon Sep 17 00:00:00 2001 From: David Peter Date: Thu, 23 Jan 2020 13:04:15 +0100 Subject: [PATCH] Show the full range in histograms Branch: master --- scripts/plot_histogram.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/plot_histogram.py b/scripts/plot_histogram.py index 2fc5df0..7e9e8b2 100755 --- a/scripts/plot_histogram.py +++ b/scripts/plot_histogram.py @@ -4,6 +4,7 @@ import argparse import json +import numpy as np import matplotlib.pyplot as plt parser = argparse.ArgumentParser(description=__doc__) @@ -17,7 +18,11 @@ with open(args.file) as f: commands = [b["command"] for b in results] all_times = [b["times"] for b in results] -plt.hist(all_times, label=commands, bins="auto", histtype="bar") +plt.hist(all_times, + label=commands, + bins="auto", + histtype="bar", + range=(np.min(all_times), np.max(all_times))) plt.legend(prop={'family': ['Source Code Pro', 'Fira Mono', 'Courier New']}) plt.xlabel("Time [s]")