热图中的叶梯度值未更改

时间:2020-02-16 12:36:07

标签: python heatmap folium

我正在尝试根据热度图的费用来绘制值,例如,最高的费用为红色,中等的费用为橙色,较少的费用为黄色。但是在热图中,我得到了相同的颜色

这些是值

 [[24.872931811611963, 67.37132880008572, 36504.0], [24.877325155114107, 67.61339129257563, 3669.0],
 [24.913628657843375, 67.86619857420588, 41328.0], [24.916074058463735, 67.0246852971121, 10760.0],
 [24.91781730263311, 67.6670564676237, 36395.0], [24.92272469856653, 67.02006086262546, 2748.0],
 [24.924113905601633, 67.69768617418957, 46423.0], [24.927141553358464, 67.50087742035363, 45170.0],
 [24.93241842084545, 67.00414752824948, 37907.0], [24.94973316983719, 67.33697998860538, 6456.0], 
 [24.957040451139875, 67.66665967155237, 14404.0], [24.95850276281118, 67.97422315179826, 19075.0],
 [24.970454753582505, 67.19954899924328, 1734.0], [24.990472166431147, 67.14979248423083, 36356.0], 
 [25.000282853119582, 67.92934854978431, 33127.0], [25.02822493425129, 67.93235697765454, 46105.0]]

这些是数据值

我希望每个点的颜色应根据渐变中设置的阈值而有所不同

m = folium.Map(location=[25.8943,68.5247],tiles='stamentoner',zoom_start=9)
HeatMap(data,gradient={0.3: 'red', 0.6: 'orange', 1: 'yellow'}).add_to(folium.FeatureGroup(name='Heat Map').add_to(m))

folium.LayerControl().add_to(m)

m

0 个答案:

没有答案