Closed
Description
The issue with axis titles overlapping with axis labels, fixed in the latest version of plotly, appears to still be present when using ggplotly to convert a faceted ggplot.
When converting an unfaceted ggplot, the new automargin=TRUE
attribute works perfectly:
mpg_plot <- mpg %>%
ggplot(aes(x = cyl, fill = trans)) +
geom_bar()
ggplotly(mpg_plot) %>%
layout(
xaxis = list(automargin=TRUE),
yaxis = list(automargin=TRUE)
)
However, when adding a facet, the old issue of overlap between axis titles and labels persists:
mpg_plot_faceted <- mpg_plot + facet_wrap(. ~ fl)
ggplotly(mpg_plot_faceted) %>%
layout(
xaxis = list(automargin=TRUE),
yaxis = list(automargin=TRUE)
)
Thanks,
Henry
For reference, the original plotly issue and related fix: