簡體   English   中英

在GeoPandas中將Legend添加到Chloropleth地圖中

[英]Adding Legend to Chloropleth map in GeoPandas

我正在嘗試在GeoPandas中為我的chrloropleth地圖添加一個圖例,並且可以設置: legend = True ,但它會出現以下錯誤:

C:\Anaconda3\lib\site-packages\geopandas\plotting.py in plot_dataframe(s, column, cmap, color, linewidth, categorical, legend, ax, scheme, k, vmin, vmax, figsize, **color_kwds)
    284             else:
    285                 # TODO: show a colorbar
--> 286                 raise NotImplementedError
    287     plt.draw()
    288     return ax

NotImplementedError: 

這似乎是說該函數尚未編寫。 問題是我看到人們在互聯網上使用它的例子,所以我想知道是否有一個我不知道的常見修復方法?

legend = True目前僅適用於分類圖。

在chloropleth地圖中有一個補丁可以實現這一點,請參閱Geopandas GeoDataFame的Choropleth地圖

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM