使用 Geopandas 在图像中添加多边形名称

问题描述

使用 geopandas 我创建了多边形和我的数据。但我想在图像中添加多边形名称。我们该怎么做?

以下是代码的最后一部分,我用来创建多边形。

fig,ax = plt.subplots(1,figsize=(25,10))

lanka_data.plot(
    column="group",cmap="BuPu",linewidth=0.4,ax=ax,edgecolor="0.1",legend=True
)

ax.axis("off")

leg = ax.get_legend()
leg.set_bBox_to_anchor((1.2,1))
leg.set_title("Mean download speed (Mbps)\nin Sri Lankan districts")

texts = []

adjust_text(
    texts,force_points=0.3,force_text=0.8,expand_points=(1,1),expand_text=(1,arrowprops=dict(arrowstyle="-",color="black",lw=0.5),)

enter image description here

我在下面的数据框中有多边形信息和多边形名称

enter image description here

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)