Python新手,我使用以下代码构建了一个可视化:
df=pd.read_csv
fig=px.scatter_mapbox(df, lat='Latitude',
lon='Longitude',
hover_name='Combined_Key',
size='Confirmed',
mapbox_style='stamen-terrain',
zoom=10,
size_max=100)
但是,我想将气泡的颜色从紫色/黄色更改为其他颜色。你能告诉我怎么改变这个吗
尝试使用这些代码。它可能会帮助您:
px.scatter_mapbox(df, lat='Lat',lon='Long_',hover_name='Combined_Key',size='Confirmed', color='Deaths',mapbox_style='stamen-terrain',zoom=4,size_max=40,cmap="Blues",alpha=0.4,edgecolors="grey",linewidth=2))
https://plotly.github.io/plotly.py-docs/generated/plotly.express.scatter_mapbox.html
color_continuous_scale
https://plotly.com/python/builtin-colorscales/range_color
到绑定值,因此色阶不受厚尾正在运行
相关问题 更多 >
编程相关推荐