mwaskom / seaborn

Statistical data visualization in Python

Home Page:https://seaborn.pydata.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature Request: Allow `multiple` parameter in `sns.countplot`

Hari-Shankar-Karthik opened this issue · comments

Heyy devs of seaborn!

I was wondering whether it might be possible to include multiple keyword in sns.counplot, similar to how it works in sns.histplot. For example, I have a dataset containing tweets by users about airlines and whether they are positive, negative or neutral. I want to make a countplot of each type of tweet per airline.

If I do sns.countplot(data=airline_tweets, y='airline', hue='airline_sentiment'), I get:

current

The behaviour I want to get is similar to doing

import seaborn.objects as so
so.Plot(airline_tweets, x='airline', color='airline_sentiment').add(so.Bar(), so.Count(), so.Stack())

wanted

I want to be able to get this by doing sns.countplot(data=airline_tweets, y='airline', hue='airline_sentiment', multiple='stack')

Thank you!

I would just use histplot here.

Thanks so much! I did sns.histplot(airline_tweets, x='airline', hue='airline_sentiment', multiple='stack') and got what I expected.