地毯圖與 KDE 陰影
既然你已經了解 displot() 的部分參數,我們可以繼續更進一步微調輸出。建立視覺化並以漸進方式更新,是從多個角度檢視資料的一種實用且常見的方法。
Seaborn 擅長讓這個流程變得簡單。
本練習屬於課程
Seaborn 資料視覺化中級
練習說明
- 以
df的Award_Amount欄位建立一個displot。 - 設定為顯示帶陰影的 KDE 圖(使用
kind與fill參數)。 - 在 x 軸上方加入地毯圖(使用
rug參數)。 - 顯示圖表。
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Create a displot of the Award Amount
sns.displot(df['____'],
kind='____',
rug=____,
fill=____)
# Plot the results
plt.____()