In [1]:
%matplotlib inline
import pandas as pd
import seaborn as sns
from matplotlib import pyplot as plt
sns.set(style="ticks", palette="BuGn")
In [2]:
table = pd.read_csv("result.csv")
In [3]:
python_happy = table[:10]
now_run_happy = table[10:20]
now_run_tracer_happy = table[20:30]
python_slow = table[30:40]
now_run_slow = table[40:50]
now_run_tracer_slow = table[50:60]
In [7]:
fig, ax = plt.subplots()
data = [python_happy.real, now_run_happy.real, now_run_tracer_happy.real]
a = sns.boxplot(ax=ax, data=data, showmeans=True)
a.set_xticklabels(["CPython", "Original\nnoWorkflow", "This\napproach"], size=20)
for tick in ax.get_yticklabels():
tick.set_fontsize(20)
a.set_title("happy.py", size=30)
a.set_yticks([x.mean() for x in data])
a.set_ylabel("Seconds", size=20)
fig.set_size_inches(7, 2, forward=True)
sns.despine()
fig.savefig('happy.png', dpi=600, bbox_inches="tight")
In [6]:
fig, ax = plt.subplots()
data = [python_slow.real, now_run_slow.real, now_run_tracer_slow.real]
a = sns.boxplot(ax=ax, data=data, showmeans=True)
a.set_xticklabels(["CPython", "Original\nnoWorkflow", "This\napproach"], size=20)
for tick in ax.get_yticklabels():
tick.set_fontsize(20)
a.set_title("slow.py", size=30)
ticks = [x.mean() for x in data]
a.set_yticks(ticks)
a.set_yticklabels([str(data[0].mean()), "{2:.3f}\n{1:.3f}".format(*ticks), ""])
a.set_ylabel("Seconds", size=20)
fig.set_size_inches(7, 2, forward=True)
sns.despine()
fig.savefig('slow.png', dpi=600, bbox_inches="tight")
In [ ]: