Skip to content

Instantly share code, notes, and snippets.

@olepbr
Last active March 7, 2023 00:21
Show Gist options
  • Save olepbr/7de38f9c45ec6683661cbdffc6984f4f to your computer and use it in GitHub Desktop.
Save olepbr/7de38f9c45ec6683661cbdffc6984f4f to your computer and use it in GitHub Desktop.
Plot & describe results of web framework energy efficiency results
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
data: pd.DataFrame = pd.read_csv("results.csv")
sns.violinplot(data=data, x="Framework", y="Energy (J)", order=["ASP.NET Core", "Actix", "Express", "Django", "Laravel"], scale="width")
plt.savefig("vioplot.png")
data.groupby("Framework").describe()
# Get rid of Laravel; it clutters the plot.
data_without_lar = data[data["Framework"] != "Laravel"]
sns.violinplot(data=data_without_lar, x="Framework", y="Energy (J)", order=["ASP.NET Core", "Actix", "Express", "Django"], scale="width")
plt.savefig("without_lar.png")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment