Feature Request: Add "stacked" argument to barplot
See original GitHub issueI’ve noticed that seaborn.barplot
doesn’t include a stacked
argument, and I think this would be a great feature to include. A similar approach to what is done with hues
(seaborn/categorical.py lines 1636:1654) could be extended to produce stacked plots.
I understand that this can be externally accomplished by pandas.DataFrame.plot(kind='bar', stacked=True)
. However, a small update here could provide an improved quality of life for those of us who appreciate the seaborn aesthetics.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:44
- Comments:8 (3 by maintainers)
Top Results From Across the Web
How to add individual proportions to a stacked bar graph ...
To calculate proportions, you may add two columns in your espoh data frame. Basically, add a column that has the total value by...
Read more >A Complete Guide to Stacked Bar Charts | Tutorial by Chartio
Stacked bar charts extend the standard bar chart by dividing each bar into multiple subcategories. Learn how to best use this chart type...
Read more >Bar Plot in Python - How to compare Groups visually
Stacked barplot. The stacked bar chart stacks bars that represent different groups on top of each other. This can be done in pandas...
Read more >Barplot - Python Graph Gallery
Stacked and Grouped barplots are a variation of the more simple barplot. They display the value of a numeric variable for each group...
Read more >Pandas Plot: Make Better Bar Charts in Python - Shane Lynn
Pandas makes this easy with the “stacked” argument for the plot command. ... Adding the stacked=True option to plot() # creates a stacked...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I disagree completely, sorry.
Just in case anyone would like this functionality, I wrote them a while back and forgot to share. I’m posting here for visibility. The
StackBarPlotter
inherits seaborn’sBarPlotter
and uses matplotlib to stack onhue
. I slightly modifiedcountplot
to use this method and also wrote afreqplot
as that’s something that’s been requested elsewhere.I would have submitted a pull request, but I wrote this before the 0.9 upgrade and as such there may be dependency issues I haven’t tested. Here’s the code.