我正在尝试使用ggplotly()和ggplot()创建一个多面图没有网格线,如下所示:
library(ggplot2)
library(plotly)
p <- iris %>%
ggplot(aes(Sepal.Length, Sepal.Width, color = Species)) +
geom_point() +
facet_wrap(~Species) +
theme_bw() +
theme(panel.grid = element_blank())
p
但是当我使用ggplotly时,网格线仍然存在:
ggplotly(p)
即使我试图使用布局调用来摆脱它们:
ggplotly(p) %>% layout(xaxis = list(automargin=TRUE, showgrid = F),
yaxis = list(automargin=TRUE, showgrid = F),
margin = list(l = 100, b = 100))
ggplotly(p) %>% layout(xaxis = list(automargin=TRUE, gridcolor = "white"),
yaxis = list(automargin=TRUE, gridcolor = "white"),
margin = list(l = 100, b = 100))
这是一个错误吗?我该如何解决?