การสร้างภาพข้อมูลด้วย 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 เบื้องต้น