Skip to content

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
Copy link
Member

@thomasp85 thomasp85 left a comment

Choose a reason for hiding this comment

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

LGTM

@teunbrand teunbrand merged commit 7cc5c72 into tidyverse:main May 19, 2025
13 checks passed
@teunbrand teunbrand deleted the simplify_scale_train branch May 19, 2025 09:09
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

2 participants