我想绘制具有最高温度值和最暗颜色的热图中的值。
我有类似[[24.8607, 67.0011, 70.0], [25.396, 68.3578, 60.0], [27.557, 68.2028, 30.0], [27.7244, 68.8228, 20.0]]
这样的数据值,其中每个列表中的数据都是lat,long和temperature值。我有相同的颜色。
map_osm = folium.Map(location=[30.3753, 69.3451],zoom_start=5)
print(data)
steps=20
colormap = branca.colormap.linear.YlOrRd_09.scale(0, 1).to_step(steps)
gradient_map=defaultdict(dict)
for i in range(steps):
gradient_map[1/steps*i] = colormap.rgb_hex_str(1/steps*i)
colormap.add_to(map_osm) #add color bar at the top of the map
HeatMap(data,gradient = gradient_map).add_to(map_osm) # Add heat map to the previously created map
map_osm