如何正确显示choropleth图

时间:2019-01-31 03:43:01

标签: python choropleth folium

threshold_scale = np.linspace(df_value_counts['Count'].min(),
                              df_value_counts['Count'].max(),
                              6, dtype=int)
threshold_scale = threshold_scale.tolist() 
threshold_scale[-1] = threshold_scale[-1] + 1 

sf_map.choropleth(
    geo_data=sf_geo,
    data=df_value_counts,
    columns=['Neighborhood', 'Count'],
key_on='feature.properties.name',
fill_color='YlOrRd', 
fill_opacity=0.7, 
line_opacity=0.2,
threshold_scale=threshold_scale,
legend_name='Crime Rate in San Francisco')

sf_map

我希望地图像this 但我得到了this

这样的地图

帮助!!

0 个答案:

没有答案