加载地物后,是否可以在Plotly District_mapbox中更改纬度和经度

2024-06-01 01:45:11 发布

您现在位置:Python中文网/ 问答频道 /正文

我有一个随时间变化的位置坐标,我想在交互式地图中显示它

if __name__ == '__main__':
    import plotly.express as px

    fig = px.scatter_mapbox({'lat': [33], 'lon': [36], 'State': ['Israel'], 'Population': [100], 'City': ['Haifa'], 'size': [20]}, lat="lat", lon="lon", hover_name="City", hover_data=["State", "Population"],
                            color_discrete_sequence=["fuchsia"], zoom=10, height=800, size="size")
    fig.update_layout(mapbox_style="open-street-map")
    fig.update_layout(margin={"r":0,"t":0,"l":0,"b":0})
    fig.show()

Tags: namecitysize时间地图figupdatemapbox