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

transform = "reverse" does not work in scale_size_area() but does in every other size scaling function #6354

Open
Lucielclr opened this issue Mar 6, 2025 · 1 comment

Comments

@Lucielclr
Copy link

The transform = "reverse" argument does not work for scale_size_area() specifically.

Examples :

  1. scale_size()
    p <- ggplot(CO2, aes(Plant, conc, size = uptake)) + geom_point(shape = 21) + scale_size(transform = "reverse", max_size = 5)

Image

  1. scale_size_area()
    p <- ggplot(CO2, aes(Plant, conc, size = uptake)) + geom_point(shape = 21) + scale_size_area(transform = "reverse")

Image

@teunbrand
Copy link
Collaborator

Thanks for the report! The transform is doing as one expects, but because the data is rescaled to the maximum (which becomes negative due to the transform), we get right back to positive numbers again.

scales::rescale_max(scales::transform_reverse()$transform(1:5))
#> [1] 1 2 3 4 5

Created on 2025-03-06 with reprex v2.1.1

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

2 participants