I’m pushing a ggplot2 graph to plotly using config options to remove the Mode Bar and autosize = T. In R, when I run the following code:
d<- ggplot(c, aes(Var1, Freq)) + geom_bar(stat=“identity”) +xlab(“”)+ ylab(“”) + ggtitle(“Title”) + scale_x_date()
d
Everything looks perfect in the window as a static graph.
When I run this using ggplotly:
ggplotly(d) %>% config(displayModeBar = F, autosize=T)
I get the following:
The graph is no longer filling the window even while setting autosize = T. Although modebar=F and the x axis scale are working fine.
when I push this to plotly using
api_create(d)
I get this graph which still is not filling the window (autosize), but now the modebar is back and the x axis has turned numeric.
Any idea what is going on here?
Thanks!