From dab1da98b6e2b92c47ba2a151a86e14fb9a8916a Mon Sep 17 00:00:00 2001 From: sharkdp Date: Thu, 2 Apr 2020 18:32:42 +0200 Subject: [PATCH] Fix computation of min/max time range --- scripts/plot_histogram.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/plot_histogram.py b/scripts/plot_histogram.py index 277b526..345a69e 100755 --- a/scripts/plot_histogram.py +++ b/scripts/plot_histogram.py @@ -18,12 +18,15 @@ with open(args.file) as f: commands = [b["command"] for b in results] all_times = [b["times"] for b in results] +t_min = np.min(list(map(np.min, all_times))) +t_max = np.max(list(map(np.max, all_times))) + plt.hist( all_times, label=commands, bins="auto", histtype="bar", - range=(np.min(all_times), np.max(all_times)), + range=(t_min, t_max), ) plt.legend(prop={"family": ["Source Code Pro", "Fira Mono", "Courier New"]})