Skip to content

Facet labels get cut off when rotated #1594

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
kojisposts opened this issue Aug 8, 2019 · 3 comments
Open

Facet labels get cut off when rotated #1594

kojisposts opened this issue Aug 8, 2019 · 3 comments

Comments

@kojisposts
Copy link

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)

スクリーンショット 2019-08-08 午後6 09 23
スクリーンショット 2019-08-08 午後6 09 45

@SoaJoli
Copy link

SoaJoli commented May 11, 2020

Hello,
I met the same issue, I would be grateful for a solution !
thanks

@SoaJoli
Copy link

SoaJoli commented May 12, 2020

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))

@AlexWeinreb
Copy link

AlexWeinreb commented Jul 29, 2024

Adapting pat-alt's comment here, this seems to work:

ggplotly(my_gg_plot) |>
      layout(margin = list(r=200))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants