0
我有一个有4个坐标的数据框用于几个观测:经度从,纬度从,经度到纬度到。 我想做出地图上出现的细分,就像在plotly的机场示例中一样https://plot.ly/r/lines-on-maps/以坐标为基础的细分图从中心开始阴谋地图
我试图更改代码以适合我的数据框。该段确实通过坐标,但它不是从第一个坐标开始,而是在全球的中心,我不明白为什么。我不确定我做错了什么。
下面是代码:
geo <- list(
scope = 'Europe',
projection = list(type = 'azimuthal equal area'),
showland = TRUE,
landcolor = toRGB("gray95"),
countrycolor = toRGB("gray80")
)
plot_geo(locationmode = 'Europe', color = I("red")) %>%
add_markers(
data = transfer.path.full[1:10,], x = ~lon_o, y = ~lat_o, text = ~name, hoverinfo = "text", alpha = 0.5
) %>%
add_segments(
data = group_by(transfer.path.full[1:10,],id),
x = ~lon_o, xend = ~lon_d,
y = ~lat_o, yend = ~lat_d,
alpha = 0.3, size = I(1), hoverinfo = "text"
) %>%
layout(title = 'E T 2016',
geo = geo, showlegend = FALSE, height=800
)
赞赏任何帮助,谢谢!
我在剧情论坛上发布了这个帖子,显然这是一个已知的问题,他们正致力于解决https://github.com/plotly/plotly.js/issues/963 –