Sometimes, just sometimes, you really want to get rid of the legend(s) in your Folium Choropleth map. However, there is no method within the Choropleth object to achieve that.
Currently, the most straightforward way of removing the legend from your map is by looping over all the layers in the Choropleth object and removing the ones that can be identified as a legend.
First, let’s create our map and choropleth layer.
import folium m = folium.Map() c = folium.Choropleth( ... )
Let’s take a look at the _children of the Choropleth object stored in c.
In the ordered dictionary, you can see a GeoJSON and a StepColormap.
By removing the StepColormap, you will be able to remove the legend from your choropleth visualization.
for key in c._children: if key.startswith('color_map'): del(c._children[key]) c.add_to(m)
Congratulations, you removed the legend from your choropleth map.