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

geom_text() justification docs are wrong #6033

Closed
willgearty opened this issue Aug 8, 2024 · 1 comment · Fixed by #6073
Closed

geom_text() justification docs are wrong #6033

willgearty opened this issue Aug 8, 2024 · 1 comment · Fixed by #6073

Comments

@willgearty
Copy link

willgearty commented Aug 8, 2024

The justification docs on this page (?geom_text) are wrong (or at least misleading). These state that a value of 0 is right/bottom and a value of 1 is top/left. Whereas the specs here rightly state that 0 = bottom/left and 1 = top/right. I think the confusion comes from the fact that left justification moves items to the right and vice versa.

library(ggplot2)
ggplot(mtcars, aes(wt, mpg, label = rownames(mtcars))) +
    geom_point() +
    geom_text(hjust = 0)

ggplot(mtcars, aes(wt, mpg, label = rownames(mtcars))) +
    geom_point() +
    geom_text(hjust = 1)

Created on 2024-08-08 with reprex v2.1.1

@teunbrand
Copy link
Collaborator

Thanks for pointing this out! I agree that the docs should be consistent with itself and it is ?geom_text that is in the wrong here.

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

Successfully merging a pull request may close this issue.

2 participants