Skip to content
Myr

Show the full range in histograms

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Peter · committed by David Peter · parent 3a99fe2 · Browse files · 1 file+6 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Trailers

  • Branch: master

Diff stats

1 file+6 added−1 removed

  • other:+6 added−1 removed

1 file+6 added−1 removed

modified:scripts/plot_histogram.py+6 added-1 removed
2 unmodified lines
3"""This program shows `hyperfine` benchmark results as a histogram."""45import argparse6import json7import numpy as np8import matplotlib.pyplot as plt910parser = argparse.ArgumentParser(description=__doc__)11parser.add_argument("file", help="JSON file with benchmark results")
5 unmodified lines
1718commands = [b["command"] for b in results]19all_times = [b["times"] for b in results]2020plt.hist(all_times, label=commands, bins="auto", histtype="bar")21plt.hist(all_times,22 label=commands,23 bins="auto",24 histtype="bar",25 range=(np.min(all_times), np.max(all_times)))26plt.legend(prop={'family': ['Source Code Pro', 'Fira Mono', 'Courier New']})2728plt.xlabel("Time [s]")29if args.title:
3 unmodified lines