Seaborn 数据可视化入门
Content Team
DataCamp

relplot() 的同样优势col= 和 row= 轻松创建子图import matplotlib.pyplot as plt
import seaborn as sns
sns.countplot(x="how_masculine",
data=masculinity_data)
plt.show()

import matplotlib.pyplot as plt
import seaborn as sns
sns.catplot(x="how_masculine",
data=masculinity_data,
kind="count")
plt.show()

import matplotlib.pyplot as plt import seaborn as snscategory_order = ["No answer", "Not at all", "Not very", "Somewhat", "Very"]sns.catplot(x="how_masculine", data=masculinity_data, kind="count", order=category_order)plt.show()

显示各类别的定量变量均值
import matplotlib.pyplot as plt
import seaborn as sns
sns.catplot(x="day",
y="total_bill",
data=tips,
kind="bar")
plt.show()


import matplotlib.pyplot as plt import seaborn as sns sns.catplot(x="day", y="total_bill", data=tips, kind="bar", errorbar=None)plt.show()

import matplotlib.pyplot as plt import seaborn as sns sns.catplot(x="total_bill", y="day", data=tips, kind="bar")plt.show()

Seaborn 数据可视化入门