繁体   English   中英

如何使用plotly在地理空间地图上绘制风箭图?

[英]how to make a wind quiver plot on the geospatial map using plotly?

我有一系列带有 u/v 分量的风数据集,并尝试在地理空间地图上使用 plot.ly 将其作为箭袋(风矢量)图。 但是,我仍然遇到麻烦来实现它。 有人可以帮我解决这个问题吗?

以下是我的代码

###- This is operating on Jupyter lab with dash extension
###- lon/lat/u/v are 2-D numpy array 

fig = ff.create_quiver(lon,lat,u,v,
                       scale=.25,
                       arrow_scale=.4,
                       name='quiver',
                       line=dict(width=1))

fig['layout'].update(title='Quiver Plot')
fig['layout'].update(geo=dict(
        resolution=50,
        scope='usa',
        showframe=False,
        showcoastlines=True,
        showland=True,
        landcolor="lightgray",
        countrycolor="white" ,
        coastlinecolor="white",
        projection=dict(type='equirectangular'),
        domain = dict(x=[0, 1], y=[ 0, 1])
))

app = dash.Dash(__name__, external_stylesheets=external_stylesheets)
app.layout = html.Div(children=[
    html.H1(children='Hello Dash'),
    dcc.Graph(
        id='example-graph-0',
        figure=fig),
])

viewer.show(app)

在保留箭头的地理位置的同时,您将无法在散点图框上使用注释。 请参阅我的解决方案,了解如何找到箭头点并将它们作为跟踪添加到地图中。 如果你有几个痕迹,即使是 40-50 个痕迹或箭头,性能也会直线下降。 不幸的是,这是一个已知的 plotly 问题,我认为这使它基本上无用。

您可以查看其他地图 API,例如谷歌地图和苹果地图。 我在 angular 应用程序中测试了谷歌地图,性能非常好。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM