为什么不showlegend = FALSE
抑制生成散点图的简化 R 代码中的图例?感谢您的帮助。
plot_ly(x = ~ 1:5, y = ~ 1:5, type="scatter",mode="markers",
color = 1:5,
showlegend = FALSE)
该showlegend
参数plot_ly
仅指因素的标签。例如
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()
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句