Python folium 地图与 Jupyter Notebook 单元格之间的白色空白

9
我该如何在Jupyter笔记本中,消除Python folium地图和下一个单元格之间不必要的空隙。以下是重现问题的简易代码:
import folium
m = folium.Map(width=600, height=400, location=[12, 12], zoom_start=2)
m

enter image description here

1个回答

13

这里的解决方案需要使用图形:

from branca.element import Figure
fig = Figure(width=600, height=400)
m = folium.Map(location=[12, 12], zoom_start=2)
fig.add_child(m)

我相信Folium有自己的图形实现,所以不确定这里是否需要Branca,但知道可以使用它是很好的。 - ZenoArrow

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接