1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| from pandas import Categorical order_days = tips.day.value_counts().index print(order_days) order_days = Categorical(["Thur","Fri","Sat","Sun"]) g = sns.FacetGrid(tips,row="day",row_order=order_days,size=1.7,aspect=4) g.map(sns.boxplot,"total_bill") CategoricalIndex(['Sat', 'Sun', 'Thur', 'Fri'], categories=['Thur', 'Fri', 'Sat', 'Sun'], ordered=False, dtype='category')
/anaconda3/lib/python3.6/site-packages/seaborn/axisgrid.py:703: UserWarning: Using the boxplot function without specifying `order` is likely to produce an incorrect plot. warnings.warn(warning)
<seaborn.axisgrid.FacetGrid at 0x1a1e4168d0>
|