-
Notifications
You must be signed in to change notification settings - Fork 30
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
support for scale_*_reverse() #343
Comments
But this works fine: library(units)
mtcars$consumption <- set_units(mtcars$mpg, mi / gallon)
mtcars$power <- set_units(mtcars$hp, hp)
ggplot(mtcars) +
geom_point(aes(power, consumption)) +
scale_x_units(unit = "W", trans="reverse") So I'm not sure what are you proposing exactly. |
It does indeed but takes some digging, but it would be more convenient if units would support all ggplot varieties of scale_*_continous. I agree it is not a very pressing issue though 👍 |
So you propose having |
I would propose to edit the documentation of scale_*_units to say that the transformation convenience functions included with ggplot (scale_*_log10(), scale_*_sqrt(), scale_*_reverse(), are not supported and include an example like:
# transform axes using the trans argument
ggplot(mtcars) +
geom_point(aes(power, 1 / consumption)) +
scale_y_units(trans= reverse_trans())
}
From: Iñaki Ucar ***@***.***>
Date: Friday, 24 February 2023 at 10:34
To: r-quantities/units ***@***.***>
Cc: Keuskamp, J.A. (Joost) ***@***.***>, Author ***@***.***>
Subject: Re: [r-quantities/units] support for scale_*_reverse() (Issue #343)
So you propose having scale_x_units_reverse, scale_x_units_log10 and so on?
—
Reply to this email directly, view it on GitHub<#343 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAHKBHAEDY7DN3MIJT4RKWLWZB6D5ANCNFSM6AAAAAAVGVAEA4>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
A feature request rather than a bug:
Units facilitates the usage of ggplot with units rather seamlessly.
A small shortcoming is the usage of
scale_*_reverse()
. This fails withbecause
scale_*_reverse()
callsscale_y_continuous(trans = scales::reverse_trans())
to invert the axis.It would be convenient if
scale_*_reverse()
would callscale_y_units(trans = scales::reverse_trans())
when applicable.The text was updated successfully, but these errors were encountered: