Introduction à la visualisation de données avec Seaborn
Erin Case
Data Scientist
Graphiques relationnels
Graphiques relationnels
Graphiques relationnels
Pourquoi utiliser relplot()
au lieu de scatterplot()
?
relplot()
vous permet de créer des sous-graphes dans une seule figureUtilisation de scatterplot()
import seaborn as sns
import matplotlib.pyplot as plt
sns.scatterplot(x="total_bill",
y="tip",
data=tips)
plt.show()
Utilisation de relplot()
import seaborn as sns
import matplotlib.pyplot as plt
sns.relplot(x="total_bill",
y="tip",
data=tips,
kind="scatter")
plt.show()
import seaborn as sns import matplotlib.pyplot as plt sns.relplot(x="total_bill", y="tip", data=tips, kind="scatter", col="smoker")
plt.show()
import seaborn as sns import matplotlib.pyplot as plt sns.relplot(x="total_bill", y="tip", data=tips, kind="scatter", row="smoker")
plt.show()
import seaborn as sns import matplotlib.pyplot as plt sns.relplot(x="total_bill", y="tip", data=tips, kind="scatter", col="smoker", row="time")
plt.show()
import seaborn as sns import matplotlib.pyplot as plt sns.relplot(x="total_bill", y="tip", data=tips, kind="scatter", col="day", col_wrap=2)
plt.show()
import seaborn as sns import matplotlib.pyplot as plt sns.relplot(x="total_bill", y="tip", data=tips, kind="scatter", col="day", col_wrap=2, col_order=["Thur", "Fri", "Sat", "Sun"])
plt.show()
Introduction à la visualisation de données avec Seaborn