如何定义没有小数点的边界数 - Choropleth

时间:2018-05-03 09:52:58

标签: python matplotlib choropleth geopandas

问题
图例中的数字有小数点(例如0.00-4.80),当我希望它们是没有小数点的整数时。

我当前的图表
Seoul city, showing poll rates area by area

我的代码

import geopandas as gpd
import matplotlib.pyplot as plt

plt.xkcd()
seoul=gpd.read_file('../json/seoul_municipalities_geo.json')
# You can download the same file from the Github below
# https://github.com/southkorea/seoul-maps/tree/master/juso/2015/json

data_result.plot(figsize=(14,10),linewidth=0.25, edgecolor='black', column='ESRI_PK',cmap='Blues',scheme='quantiles',legend=True)

for index,row in seoul.iterrows():
    xy=row['geometry'].centroid.coords[:]
    xytext=row['geometry'].centroid.coords[:]
    plt.annotate(row['SIG_ENG_NM'],xy=xy[0], xytext=xytext[0],  horizontalalignment='center',verticalalignment='center')
    plt.axis('off')

plt.show()

0 个答案:

没有答案