'How to change map background with mplleaflet

I create heat maps on Python and find mplleaflet very practical.

However, when we want to use colors from green to red (like 'RdYlGn' here https://matplotlib.org/3.3.2/gallery/color/colormap_reference.html#sphx-glr-gallery-color-colormap-reference-py), the colors don't come out well.

I would like to find a way to have a black and white map background, I have tried to change tiles parameter, but I juste get a grey background without a map.

For example with this dataset : https://dataworks.calderdale.gov.uk/dataset/museums (geojson file) :

data_test_stack = gpd.read_file('Museums 2021.geojson')
data_test_stack.reset_index(inplace=True)

fig, ax = plt.subplots(figsize = (8,6)) 
data_test_stack.plot(ax=ax, column='index', cmap='RdYlGn_r', legend=True)
ax.set_axis_off()
mplleaflet.show(fig=fig, crs={'init': 'epsg:4326'}, tiles='mapbox bright')

It doesn't work with tiles='mapbox bright'.

Do you know how to build a map with black and white map background ?



Solution 1:[1]

I'm not sure but it seems not possible after further research : "You should use a different library if you need fine control over the basemap" is written on https://github.com/jwass/mplleaflet

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Elise1369