Add Annotation to 3D Scatterplot in Plotly

核能气质少年 提交于 2019-12-06 03:31:09

Using the iris dataset (you did not provide a reproducible example) you could try:

set.seed(100)
d <- diamonds[sample(nrow(diamonds), 1000), ]

p <- plot_ly(d, x = carat, y = price, z=depth, text = paste("Clarity: ", clarity),
        type="scatter3d", mode="markers")

p %>% 
add_trace(x = 2.5, y = 5000, z = 0, type = "scatter3d", text = "test", mode = "text") %>% 
add_trace(x = 2.5, y = 15000, z = 0, type = "scatter3d", text = "test", mode = "text") %>% 
layout(showlegend = FALSE)

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!