#34 Grouped Boxplot





Grouped boxplot are used when you have a numerical variable, several groups and subgroups.

It is easy to realize one using seaborn.Y is your numerical variable, x is the group column, and hue is the subgroup column.







# library and dataset
import seaborn as sns
df = sns.load_dataset('tips')

# Grouped boxplot
sns.boxplot(x="day", y="total_bill", hue="smoker", data=df, palette="Set1")

  • Sponsors

  • 1 comment

    • thanks for the tutorial; if i wanna do the t-test within each group? and show the asterisks. whats the most efficient way of doing it?


    Leave a Reply

    Your email address will not be published.