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 # Set alpha to be between 0 and 1 sns.relplot(x="total_bill", y="tip", data=tips, kind="scatter", alpha=0.4)plt.show()

Seaborn 資料視覺化入門