Commit 4b949713 authored by John Zhang's avatar John Zhang

target name as xticks label, display std_dev

parent d6265d34
Pipeline #196 failed with stage
in 24 minutes and 34 seconds
......@@ -267,20 +267,27 @@ def plot(result_dic):
all_targets = ('cpython', 'pypy', 'pypy_nojit', 'rpy_c', 'rpy_mu', 'c')
compiled_targets = ('rpy_c', 'rpy_mu', 'c')
targets = compiled_targets
data = [(tgt, result_dic[tgt]['average'], result_dic[tgt]['std_dev'])
for tgt in compiled_targets]
for tgt in targets]
data.sort(key=lambda (tgt, avg, std): avg)
for i, (tgt, avg, std_dev) in enumerate(data):
ax.bar(width / 2 + width * i, avg, width, color=colors[i], yerr=std_dev, label=tgt)
ax.text(width / 2 + width * i + 0.01, avg, "%.6f" % avg, color='#1d1f21', fontweight='bold')
ax.text(width * (i + 1), avg - std_dev, "%.6f" % std_dev, color='#1d1f21', fontweight='bold')
plt.legend(loc=2)
# plt.legend(loc=2)
plt.xticks([width * (i + 1) for i in range(len(targets))], targets)
plt.title("%(test_name)s with input size %(input_size)d" % result_dic)
plt.show()
def test_plot():
plot(perf_quicksort(1000, 20))
# import json
# with open('result_quicksort.json', 'r') as fp:
# dic = json.load(fp)
# plot(dic)
if __name__ == '__main__':
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment