การปรับแต่งสไตล์ scatterplot
ในแบบฝึกหัดนี้ จะใช้ plt.scatter() เพื่อพล็อตข้อมูลความสูงของพ่อและลูกชายจากวิดีโอ DataFrame ชื่อ father_son ถูกโหลดไว้ให้แล้ว ในแต่ละ scatterplot ให้ใช้ father_son.fheight เป็นแกน x และ father_son.sheight เป็นแกน y
แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร
การแสดงผลข้อมูลเชิงภูมิศาสตร์ด้วย Python
แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ
ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์
# Import matplotlib.pyplot
import matplotlib.pyplot as ____
# Scatterplot 1 - father heights vs. son heights with darkred square markers
plt.scatter(father_son.fheight, father_son.sheight, ____ = 'darkred', ____ = 's')
# Show your plot
plt.____()