Geopandas中的自定义Choropleth标签

我正在尝试在geopandas中制作一个choropleth图。由于对象数量众多,并且分布高度偏斜,因此我将使用内置的mapclassify支持将分档为分位数。效果很好,除了生成的图例的标签很糟糕。

作为测试用例,我产生了以下内容:

Geopandas中的自定义Choropleth标签

使用以下代码:

import geopandas as gp
import matplotlib.pyplot as plt

world = gp.read_file(gp.datasets.get_path('naturalearth_lowres'))
fig,ax = plt.subplots()
world.plot(ax=ax,column='pop_est',cmap='OrRd',scheme='quantiles',legend=True,legend_kwds=dict(loc='upper right',bbox_to_anchor=(1.5,.9),fontsize='small',title="Legend",frameon=False)
           )
ax.axis('off')

我至少希望能够为图例具有完全自定义的标签,例如:

  • 236万
  • ...
  • > 3,800万

但是,理想的情况是使带有自定义标签的色块连续出现,例如下面的美国地图(我未制作):

Geopandas中的自定义Choropleth标签

wxyxxlh 回答:Geopandas中的自定义Choropleth标签

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3135926.html

大家都在问