Seaborn boxplot color outliers by hue variable using seaborn =< 0.12.2

30 views Asked by At

I would like to color my boxplot-outliers in my Seaborn Boxplot when using a hue variables. Something along the line of this, from seaborn boxplot examples, but I am stuck on seaborn ver. 0.12.2

sns.boxplot(data=titanic, x="class", y="age", hue="alive", fill=False, gap=.1)

As I'm stuck here I get this. What should I change? Any way it's possible in this seaborn version? It's unfortunately currently not an option for me to update my working environment. Thanks.

enter image description here

import seaborn as sns
import matplotlib.pyplot as plt

# Sample data
data = sns.load_dataset('tips')

# Boxplot with outliers colored by hue variable ('sex' in this 
sns.boxplot(data=data, x='day', y='total_bill', hue='sex')

plt.show()
0

There are 0 answers