-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Set width
as aesthetic in geom_col()
/geom_bar()
.
#5807
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.
LGTM
Not sure whether I should comment here or on the issue :
produces : I checked that I have the correct version of
... does not have the |
Can I ask what height issue exactly?
Running that code with the CRAN version or even older versions such as 3.4.4 yields the same plot, so I'm reasonably sure that this PR didn't affect that outcome. |
|
For the other issue, I did not say that you break anything ! Just that the result does not fit my expectations. If :
... produces : ... then I do not expect the columns to get crumble together when I add a |
The
It does, and there is no need for library(ggplot2)
ggplot(mtcars, aes(mpg, rownames(mtcars))) +
geom_col(width = 0.5) Created on 2024-05-23 with reprex v2.1.0 |
So it was my understanding all along, sorry for that.
I was not expecting either
... indeed yields : Last thing, in the preivous graph, I expected equal column spacing, irrespective of the width, as the only meaningful case I have in mind for variable-width column charts is this : ... but maybe I was wrong here again and that is not what you or anyone had in mind. Thank you for your patience and clarification. Should I forward these comments somewhere where they are more useful ? Maybe am I not the only confused one ? |
This PR aims to fix #3142.
Motivation is given here: #3142 (comment). To recap: yes variable width bars are bad, but we allowed them implicitly anyway and are jumping through hoops to clunkily discourage it.
This PR removes the hack that recognises
width
as a parameter, and implements it as an aesthetic instead.