Seaborn: Using the "hue" attribute makes plots with bars thin

Created on 13 Jul 2016  路  3Comments  路  Source: mwaskom/seaborn

This is an issue related to #824 and this StackOverflow question.

To copy the example in the previous issue:

tips = sns.load_dataset("tips")
sns.barplot(x="day", y="total_bill", hue="sex", data=tips, width=.3)

This works fine using the x and y attributes, but adding the hue attribute makes the bars thin. Is there a workaround?

Most helpful comment

tips = sns.load_dataset("tips")
sns.barplot(x="day", y="total_bill", hue="sex", data=tips,dodge=False)

Add attribute dodge=False
Instead of creating different bar for single value. Adding dodge=False shows the data in single bar per variable.

All 3 comments

Yes, this is by design #871

@mwaskom Is there perhaps documentation I'm missing to use hue and not have thin bars? Or is the StackOverflow response the only relevant documentation?

tips = sns.load_dataset("tips")
sns.barplot(x="day", y="total_bill", hue="sex", data=tips,dodge=False)

Add attribute dodge=False
Instead of creating different bar for single value. Adding dodge=False shows the data in single bar per variable.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sungshine picture sungshine  路  3Comments

tritemio picture tritemio  路  3Comments

ConstantinoSchillebeeckx picture ConstantinoSchillebeeckx  路  4Comments

chanshing picture chanshing  路  3Comments

JanHomann picture JanHomann  路  3Comments