Skip to content

Feature Request: nudge_x and nudge_y as a true aesthetic #5445

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

Closed
lhami opened this issue Sep 28, 2023 · 1 comment · Fixed by #6100
Closed

Feature Request: nudge_x and nudge_y as a true aesthetic #5445

lhami opened this issue Sep 28, 2023 · 1 comment · Fixed by #6100
Labels
feature a feature request or enhancement layers 📈

Comments

@lhami
Copy link

lhami commented Sep 28, 2023

Sometimes I want more granular control over the position of specific text labels for geom_text and geom_text_repel, and I may want that to depend on some other aspect of the data (overlapping points, points that are above a certain threshold, specific problematic points that I know by name from previous versions, etc) using mutate().

Since nudge_x and nudge_y can take vectors that are the same length as the data, it seems already acknowledged that people may want to sometimes have a different nudge value for each point, which could easily be a column of nudge values in the data frame or a function thereof, so I'm not sure why it works differently from other aesthetics which can be specified in aes() with a column name quosure or outside of aes() for all points.

Could we make nudge_x and nudge_y work like the x and y aesthetics themselves?

@lhami lhami changed the title nudge_x and nudge_y as a true aesthetic Feature Request: nudge_x and nudge_y as a true aesthetic Sep 28, 2023
@teunbrand
Copy link
Collaborator

Some time ago there was some relevant discussion in #3026 and a PR implementing this was posted in #3030.
At the time, it was decided against making nudge_x and nudge_y proper aesthetics, because it was too niche for the geom_text()/position_nudge() pairing. The alternative proposed solution, but never implemented, was to make position adjustments have required aesthetics that can be interpreted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement layers 📈
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants