Folium 文档目前不完整: https ://folium.readthedocs.io/en/latest/
根据不完整文档的索引,Legends 和 Layers 是或将被支持。我花了一些时间在网上寻找示例,但到目前为止一无所获。如果有人知道如何创建这些东西,或者可以给我指出文档或教程,我将不胜感激。
原文由 sparrow 发布,翻译遵循 CC BY-SA 4.0 许可协议
您可以很容易地添加图例;
#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)
你可以在这里看到我的完整例子;
原文由 Harley 发布,翻译遵循 CC BY-SA 4.0 许可协议
2 回答5.1k 阅读✓ 已解决
2 回答1.1k 阅读✓ 已解决
4 回答1k 阅读✓ 已解决
3 回答1.1k 阅读✓ 已解决
3 回答1.2k 阅读✓ 已解决
1 回答1.7k 阅读✓ 已解决
1 回答1.2k 阅读✓ 已解决
Folium 现在可以通过 0.15 版轻松添加图像。