-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Feature request: allow function as argument value in scale_*(limits=)
#2307
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
Comments
Is using the |
I don't think so. Following on the example above, you might want a y-scale that ends exactly at multiples of 10, e.g.
I don't see how you can achieve that in a general way using
The other advantage of setting the
|
I like the idea in principle, but it feels it bit too different to breaks/labels since if you supply an argument to |
Uh oh!
There was an error while loading. Please reload this page.
Request is to allow
limits
arg in e.g.scale_x_continuous
to accept a function which takes the default limits and returns new limits, in parallel with the same functionality inbreaks
andlabels
.At present it seems like the two options are (1) specify literal limits, which is inflexible (2) calculate the preferred limits outside of the ggplot statement, but that is messy and can result in redoing calculations already happening inside ggplot (e.g. for position="stack").
It looks like this may be a one line change in scale-.r's
get_limits
, but I don't know my way around well enough to be sure.Motivating example follows.
The text was updated successfully, but these errors were encountered: