-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Repurpose coord expansion #6027
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this idea
@@ -89,6 +89,7 @@ CoordFlip <- ggproto("CoordFlip", CoordCartesian, | |||
}, | |||
|
|||
setup_panel_params = function(self, scale_x, scale_y, params = list()) { | |||
params$expand <- params$expand[c(2, 1, 4, 3)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure flipping the coord params is the logical solution here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this PR, coord_flip(expand = c(left = FALSE))
removes the left expansion, which feels correct to me. I don't know how much this intuition holds, but I feel like coord_flip()
swaps x/y, but not left/bottom and right/top.
I'm unsure whether there is a more logical solution available here.
This PR aims to fix #6020.
Briefly, it allows
expand
to take a length-4 logical vector for each of the positions (top, right, bottom, left).Alternatively, one could use a named vector too.
Created on 2024-08-05 with reprex v2.1.1