plotly.R
plotly.R copied to clipboard
Facet labels get cut off when rotated
I suspect this is a similar issue to #1224 : when graphs are facetted vertically, and the facet labels rotated to be horizontal, the labels are cut off. (Where there is a legend, it overlaps; where there isn't, it's cut off entirely.)
p <- flights %>%
ggplot(aes(y=origin, x=dest, colour=origin)) +
geom_count() +
facet_grid(name ~.) +
theme(strip.text.y = element_text(angle = 0),
legend.position = "none")
ggplotly(p)

Hello, I met the same issue, I would be grateful for a solution ! thanks
I fixed this issue with : p<-ggplotly(p,tooltip = c("y", "x", "fill"), width = cdata$output_plot2_width, height = cdata$output_plot2_height) %>% layout(legend = list(orientation = 'v',xanchor= "top",x = 1.1, y = 1))
Adapting pat-alt's comment here, this seems to work:
ggplotly(my_gg_plot) |>
layout(margin = list(r=200))