Seabornで学ぶデータ可視化入門
Content Team
DataCamp
2つの量的変数の関係を可視化
既習:
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 # 透明度は 0〜1 sns.relplot(x="total_bill", y="tip", data=tips, kind="scatter", alpha=0.4)plt.show()

Seabornで学ぶデータ可視化入門