Skip to content

Simplify scale training #6443

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
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

teunbrand
Copy link
Collaborator

This PR aims to fix #6184.

Briefly, the actual solution is already implemented in the scales package in r-lib/scales#481. We just adapt ggplot2 to this solution by abdicating responsibility to scales.

Comment on lines +206 to +207
Discrete value supplied to a continuous scale.
i Example values: "A" and "E".
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Arguably slightly worse, but if we want to improve this, this should happen in the scales package.

Comment on lines +1180 to +1182
if (length(x) == 0) {
return()
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency's sake early exit first

@teunbrand teunbrand added this to the ggplot2 4.0.0 milestone May 6, 2025
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

Successfully merging this pull request may close these issues.

implementation strategy: robust ggplot2 functionality for visualizing vctrs-objects
1 participant