简体   繁体   English

在GeoPandas中将Legend添加到Chloropleth地图中

[英]Adding Legend to Chloropleth map in GeoPandas

I am trying to add a legend to my chrloropleth map in GeoPandas and there is a option to set : legend = True , but it comes up with the following error: 我正在尝试在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: 

Which appears to be saying that the function hasn't been written. 这似乎是说该函数尚未编写。 The thing is I see examples of people using it on the internet so I was wondering if there was a common fix for this that I don't know about? 问题是我看到人们在互联网上使用它的例子,所以我想知道是否有一个我不知道的常见修复方法?

legend = True is currently functional only for categorical plots. legend = True目前仅适用于分类图。

There is a patch to enable this in chloropleth maps, see Choropleth map from Geopandas GeoDataFame . 在chloropleth地图中有一个补丁可以实现这一点,请参阅Geopandas GeoDataFame的Choropleth地图

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM