3

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:

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?

user1058210
  • 1,639
  • 7
  • 29
  • 49

1 Answers1

2

legend = True is currently functional only for categorical plots.

There is a patch to enable this in chloropleth maps, see Choropleth map from Geopandas GeoDataFame.

Community
  • 1
  • 1
Matt
  • 21
  • 4