Seaborn 数据可视化入门
Content Team
DataCamp
展示两个定量变量的关系
已学内容:
col 与 row)hue)新增自定义:
适用于 scatterplot() 与 relplot()
import seaborn as sns import matplotlib.pyplot as plt sns.relplot(x="total_bill", y="tip", data=tips, kind="scatter", size="size")plt.show()

import seaborn as sns import matplotlib.pyplot as plt sns.relplot(x="total_bill", y="tip", data=tips, kind="scatter", size="size", hue="size")plt.show()

import seaborn as sns import matplotlib.pyplot as plt sns.relplot(x="total_bill", y="tip", data=tips, kind="scatter", hue="smoker", style="smoker")plt.show()

import seaborn as sns import matplotlib.pyplot as plt # 将 alpha 设为 0 到 1 之间 sns.relplot(x="total_bill", y="tip", data=tips, kind="scatter", alpha=0.4)plt.show()

Seaborn 数据可视化入门