擅长:python、mysql、java
<p>你可以很容易地添加一个传说</p>
<pre><code>#specify the min and max values of your data
colormap = branca.colormap.linear.YlOrRd_09.scale(0, 8500)
colormap = colormap.to_step(index=[0, 1000, 3000, 5000, 8500])
colormap.caption = 'Incidents of Crime in Victoria (year ending June 2018)'
colormap.add_to(world_map)
</code></pre>
<p>你可以在这里看到我完整的例子</p>
<p><a href="https://stackoverflow.com/questions/52911688/python-folium-choropleth-map-colors-incorrect/52981115#52981115">Folium Map with legend example</a></p>