-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
regression: bar plot with multi-column category doesn't work anymore #21386
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
also related: #19699 |
cc @TomAugspurger : Labeled as regression, but of course, feel free to modify if change was deliberate. |
Is the issue still open? If so, I would like to work on this. |
cc @masongallo if you recall the discussion around this. |
@daminisatya yes, as far as I know this is not yet resolved |
A few comments:
|
@masongallo :
I understand for the use case of line and scatter plots,
In my mind, the For completeness I also tried it out with |
Allowing multiple `x` might make sense for bar / barh.
FWIW, I would personally do this with df.set_index(['fruit',
'animal'])['size'].plot.bar()
…On Wed, Jun 13, 2018 at 4:12 AM, Stefaan Lippens ***@***.***> wrote:
@masongallo <https://github.com/MasonGallo> :
I just used barh to make sure the screenshot was easily readable,
The "feature" also used to work for standard bar in pandas 0.22:
[image: screen shot 2018-06-13 at 10 48 04]
<https://user-images.githubusercontent.com/44946/41340291-521128e2-6ef7-11e8-821e-be14f586f56e.png>
The change was intentional to conform with the api & docs
I understand for the use case of line and scatter plots,
but for categorical plots like bar (and pie see lower), I think it would
be an interesting feature to bring back support for multi-column based
labels. Is there interest for that @TomAugspurger
<https://github.com/TomAugspurger> ?
The signature of barh in pandas is quite confusing to me
In my mind, the x/y handling in barh makes sense as I see barh as a
flipped version of bar: the x-axis is drawn vertically and y-axis is
drawn horizontally. During data exploration, I usually switch between bar
and barh functions names to improve readability of the labels, and in
that process I don't want to also change the arguments of those functions.
That being said, I think the axis handling of barh is probably another
discussion and out of scope of this ticket.
For completeness I also tried it out with pie, but there the x argument
seems to be ignored completely, so it kind of works with both 0.22 and
0.23. However, the pie piece labels come from the index instead of the
given x column. But that is probably another (known) issue.
[image: screen shot 2018-06-13 at 10 49 45]
<https://user-images.githubusercontent.com/44946/41340518-e0ed1c4c-6ef7-11e8-9b93-ed97ea6b3bca.png>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#21386 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABQHInXYqoecXRFXxguCDPJM7pyzrFWgks5t8NdogaJpZM4UgdDm>
.
|
Code Sample, a copy-pastable example if possible
Doing a bar plot using a multi-column category used to work
In pandas 0.22.0:

since pandas 0.23.0:

Is it intended that this stopped working?
I kind of liked the feature.
The text was updated successfully, but these errors were encountered: