全世界的情节位置模式

发布于 2025-01-25 10:33:17 字数 121 浏览 3 评论 0原文

我正在尝试为全世界的某些数据创建唱片地图,并且我正在使用plotly来做,但发现locationmode示例都在美国国家/

地区我在世界上使用它的一种方式

I am trying to create a choropleth map for some data of the whole world and I am using plotly to do it but found that locationmode examples are all on Usa-States

Is there a way for me to use it on the world

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

原谅我要高飞 2025-02-01 10:33:17

基于plotly 文档
示意您有一个dataframe lats ond lons :

import plotly.graph_objects as go
fig = go.Figure(data=go.Scattergeo(
        lon = df['lon'],
        lat = df['lat'],
        mode = 'markers',
        ))

fig.update_layout(
        title = 'world map with markers',
        geo_scope='world',
    )
fig.show()

Based on the plotly documentation.
Givent that you have a DataFrame of lats ond lons:

import plotly.graph_objects as go
fig = go.Figure(data=go.Scattergeo(
        lon = df['lon'],
        lat = df['lat'],
        mode = 'markers',
        ))

fig.update_layout(
        title = 'world map with markers',
        geo_scope='world',
    )
fig.show()
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文