Colormap
เมื่อต้องการแสดงความแตกต่างระหว่างพื้นที่โดยไม่ต้องการสื่อความสัมพันธ์เชิงปริมาณ colormap แบบ qualitative คือตัวเลือกที่เหมาะสมที่สุด
ในแบบฝึกหัดนี้ คุณจะเปรียบเทียบ colormap แบบ qualitative กับแบบ sequential (quantitative) โดยใช้ GeoDataFrame ของเขตโรงเรียน ซึ่งพร้อมใช้งานในตัวแปรชื่อ school_districts
แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร
การแสดงผลข้อมูลเชิงภูมิศาสตร์ด้วย Python
แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ
ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์
# Set legend style
lgnd_kwds = {'title': 'School Districts',
'loc': 'upper left', 'bbox_to_anchor': (1, 1.03), 'ncol': 1}
# Plot the school districts using the tab20 colormap (qualitative)
school_districts.plot(column = ____, ____ = 'tab20', ____ = True, ____ = lgnd_kwds)
plt.xlabel('Longitude')
plt.ylabel('Latitude')
plt.title('Nashville School Districts')
plt.show();