Python 形成颜色图叶

Python folium colormap format

我想将科学记数法添加到我的 LinearColormap folium 地图中

colormap = branca.colormap.linear.RdPu_09.scale(min_col,max_col)

为了避免在我的 jupyter notebook 中出现不可读的比例: 有没有办法修改刻度刻度格式化程序?

...经过我的一段代码的巨大挣扎!

my_js = """
        [![enter image description here][1]][1]var div = document.getElementById('legend');
        var ticks = document.getElementsByClassName('tick')
        for(var i = 0; i < ticks.length; i++){
        var values = ticks[i].textContent.replace(',','')
        val = parseFloat(values).toExponential(2).toString()
        if(parseFloat(ticks[i].textContent) == 0) val = 0.
        div.innerHTML = div.innerHTML.replace(ticks[i].textContent,val);
        }
        """
        e = Element(my_js)
        html = colormap.get_root()
        html.script.get_root().render()
        html.script._children[e.get_name()] = e