I'm trying to use ggplotly() with ggplot() to create a faceted graph without gridlines, like this:
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
But when I use ggplotly, the grid lines remain:
ggplotly(p)
Even when I try to get rid of them using calls to layout:
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))
Is this a bug? How can I solve it?