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

breaks_width() does not work with reverse transform #435

Open
teunbrand opened this issue Jun 3, 2024 · 0 comments
Open

breaks_width() does not work with reverse transform #435

teunbrand opened this issue Jun 3, 2024 · 0 comments

Comments

@teunbrand
Copy link
Contributor

teunbrand commented Jun 3, 2024

To reproduce:

library(scales)
demo_continuous(
  c(0, 10), 
  transform = "reverse", 
  breaks = breaks_width(1)
)
#> scale_x_continuous(transform = "reverse", breaks = breaks_width(1))
#> Error in seq.default(round_any(range[1], size, floor), round_any(range[2], : wrong sign in 'by' argument

Created on 2024-06-03 with reprex v2.1.0

I think fullseq() should sort the range before computing the breaks to fix the issue.
Arguebly, user should use breaks = breaks_width(-1), but that sort of departs from the idea that break function input is specified in original space, not transformed space.

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

No branches or pull requests

1 participant