開始使用免費開始

在多邊形上繪製點-第 1 部分

請將雞隻的位置疊加在服務區域上,做出一個基本的繪圖。所需的套件都已為你匯入。chickens DataFrame 與 service_district GeoDataFrame 也已預先載入。

本練習屬於課程

在 Python 視覺化地理空間資料

檢視課程

練習說明

  • 繪製服務區域的 shapefile,並使用 name 欄位為多邊形著色。
  • 加上雞隻的位置,使用 chickens DataFrame 中的 latlng 欄位,並將點設為黑色。
  • 顯示你的圖。

動手互動練習

試著完成這個範例程式碼,體驗一下這個練習。

# Plot the service district shapefile
service_district.plot(column=____)

# Add the chicken locations
plt.scatter(x=____, y=____, ____ = 'black')

# Show the plot
plt.____()
編輯並執行程式碼