-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Scale expand value from scales ignored when coord_cartesian ylim is used #3270
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
Can you elaborate on what part is unexpected? |
Once I specify Suppose you wanted to specify a |
I think this is a reasonable feature request. Not sure about the best API, though. Is it appropriate for the coord to look up the expansion factors specified in the scale? I guess it's similar to looking up breaks and labels, so maybe that's the best way to go. |
Will you guys consider a PR for this then, or do you want to address it yourselves? I can do it, but might be a little while before I get to it. |
I doubt it's high on anybody's todo list right now. You can tackle it when you have the time. |
This appears to be fixed in the master branch, so I am closing: library(ggplot2)
p <- ggplot(data.frame(x='a', y=100)) +
geom_col(aes(x, y)) +
scale_y_continuous(expand=expand_scale(mult=c(0.05, 0.50)))
p + ggtitle('Simple') p + ggtitle('w/ coord_cart lim') +
coord_cartesian(ylim=c(0, 100)) p + ggtitle('w/ coord_cart lim expand false') +
coord_cartesian(ylim=c(0, 100), expand=FALSE) Created on 2019-06-23 by the reprex package (v0.2.1) |
Wonderful, I didn't even have to do anything. Thanks! |
This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/ |
It would be desirable to be able to specify 'expand' values in conjunction with
coord_cartesian(ylim=...)
. That does not appear to work, as the expand values are reverted back to defaults. If you agree the current behavior is unexpected I can look into a PR.Created on 2019-04-24 by the reprex package (v0.2.1)
Session info
The text was updated successfully, but these errors were encountered: