Skip to content
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

hjust = "outward" not working for some angles #4169

Closed
bersbersbers opened this issue Aug 12, 2020 · 0 comments · Fixed by #4447
Closed

hjust = "outward" not working for some angles #4169

bersbersbers opened this issue Aug 12, 2020 · 0 comments · Fixed by #4447
Labels
bug an unexpected problem or unintended behavior layers 📈
Milestone

Comments

@bersbersbers
Copy link
Contributor

In the following code, the label "Annotation0" is not adjusted "outwards", while the other two are.

library(ggplot2)
print(ggplot(data.frame(x = c(0, 1, 2))) +
  geom_text(aes(
    x = x,
    y = 1,
    label = paste0("Annotation", x),
    angle = x * 60 - 90, 
    hjust = "outward"
    )) + 
  coord_polar() +
  scale_x_continuous(limits = c(0, 3))
)

image

@thomasp85 thomasp85 added bug an unexpected problem or unintended behavior layers 📈 labels Aug 31, 2020
@thomasp85 thomasp85 added this to the ggplot2 3.3.4 milestone Mar 25, 2021
aphalo added a commit to aphalo/ggplot2 that referenced this issue May 3, 2021
The problem described in tidyverse#4169 has changed but is not solved yet.
aphalo added a commit to aphalo/ggplot2 that referenced this issue May 4, 2021
 Add the logic needed to handle correctly the larger angles. The previous code worked correctly only for angle in -135...135. This also solves tidyverse#4169.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior layers 📈
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants