【发布时间】:2018-04-25 00:12:01
【问题描述】:
为什么showlegend = FALSE 不抑制这个简化的 R 代码中的图例,生成一个散点图?感谢您的帮助。
plot_ly(x = ~ 1:5, y = ~ 1:5, type="scatter",mode="markers",
color = 1:5,
showlegend = FALSE)
【问题讨论】:
为什么showlegend = FALSE 不抑制这个简化的 R 代码中的图例,生成一个散点图?感谢您的帮助。
plot_ly(x = ~ 1:5, y = ~ 1:5, type="scatter",mode="markers",
color = 1:5,
showlegend = FALSE)
【问题讨论】:
plot_ly 中的showlegend 参数仅指因子标签。例如
plot_ly(x = ~ 1:5, y = ~ 1:5, type="scatter",mode="markers",
color = as.factor(1:5))
plot_ly(x = ~ 1:5, y = ~ 1:5, type="scatter",mode="markers",
color = as.factor(1:5), showlegend = FALSE)
很遗憾,showscale 没有针对散点图实现,因此您需要使用不太优雅的 hide_colorbar() 函数来处理色标:
plot_ly(x = ~ 1:5, y = ~ 1:5, type="scatter",mode="markers",
color = 1:5) %>% hide_colorbar()
【讨论】: