阅读plotly的文档时,我想我可以使用griddash
来设计网格线的样式,使其不是实线而是虚线(比如说)。
但是,这并不起作用(gridcolor
和gridwidth
确实起作用,这里只是为了更好的可见性):
library(plotly)
d <- data.frame(x = LETTERS[1:3], y = c(13, 50, 97))
plot_ly(d) %>%
add_trace(x = ~ x, y = ~ y, type = "bar") %>%
layout(yaxis = list(griddash = "dot", gridwidth = 2, gridcolor = "red"))
手动添加stroke-dasharray
就可以了:
这让我相信这是一个错误,应该这样归档?
1条答案
按热度按时间mjqavswn1#
这个参数(以及其他几个参数)不起作用的原因是Plotly JS依赖。现在R包似乎仍然在使用2.11.1。与此同时,Plotly JS在2.22上?两点二三?
如果您希望能够使用这个参数,这是使
plotly
为您所用的一种方法--更改依赖项。顺便说一句,我在这里使用了2.21,因为我已经经常使用这个块了。您始终可以捕获较新版本的依赖项URL。