Simple barchart with Seaborn

Using this stack overflow answer

In [13]:
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt


x = [1,2,3]

y = [4, 9, 2]
z = [1, 2, 3]
k = [11, 12, 13]

# number_of_bars
n_bars = 3

df = pd.DataFrame(zip(x*n_bars, ["y"]*len(x)+["z"]*len(x)+["k"]*len(x), y+z+k), columns=["time", "kind", "data"])
plt.figure(figsize=(10, 6))
sns.barplot(x="time", hue="kind", y="data", data=df)
plt.show()
In [ ]: