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()
def make_bar_plot():
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()
sns.set()
tips = sns.load_dataset("tips")
tips[:5]
# import seaborn as sns
# sns.set()
# tips = sns.load_dataset("tips")
# sns.relplot(x="total_bill", y="tip", col="time",
# hue="smoker", style="smoker", size="size",
# data=tips);
sns.relplot(x="total_bill", y="tip", col = "time", hue="smoker", size="size", data=tips)
def make_plot(x, y, col, color, size, data):
sns.set()
sns.relplot(x=x, y=y, col=col, hue=color, size=size, data=data)
data = sns.load_dataset("tips")
make_plot('total_bill', 'tip', 'time', 'smoker', 'size', data)