![](/img/trans.png)
[英]How to add annotations to a scatter3D Plotly plot using scene?
[英]How to make plotly marker labels in scatter3d plots the same color as the marker?
最终,所有标签都使用相同的颜色,并使用以下最小示例:
plot_ly(
data = mtcars,
type = "scatter3d",
mode = "markers",
colors = c("blue","red"),
text = row.names(mtcars),
hoverinfo = "text",
color = ~cyl,
x = ~disp,
y = ~hp,
z = ~qsec
)
使用以下方法可以实现:
plot_ly(
data = mtcars,
type = "scatter",
mode = "markers",
colors = c("blue","red"),
text = row.names(mtcars),
hoverinfo = "text",
color = ~cyl,
x = ~disp,
y = ~hp
)
我知道在此示例中,图例的颜色范围不合适,但是对于此代码使用的实际数据来说,它是必需的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.