I'm drawing colored regions on a folium
map using log scale shading. Using custom colormap, the region colors seem to be ok. But the colormap, when added to the map legend, still looks linear:
Is there any way to draw it as equal-width colored rectangles with text values underneath?
import numpy as np, branca, folium
m = folium.Map()
colormap = branca.colormap.LinearColormap(colors=['blue', 'green', 'yellow', 'orange', 'red'],
index = np.round(np.exp(np.linspace(0, 9, 5))),
vmin = 0, vmax = np.exp(9),
).to_step(n=6, index=np.round(np.exp(np.linspace(0, 9, 6))))
colormap.add_to(m)