pythonfolium

White gap between Python folium map and jupyter notebook cell


How can I remove the undesired gap between the Python folium map and the next cell inside my jupyter notebook. Here the naive code to reproduce my problem :

import folium
m = folium.Map(width=600, height=400, location=[12, 12], zoom_start=2)
m

enter image description here


Solution

  • Here the solution need to use Figure :

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