'Seaborn catplot sort by columns
I am trying to sort the columns in seaborn catplot and I am unable to perform this operation. I know I can sort the bars within the graph using order= but how to sort the columns?
So far, I have written this code for plotting:
top_codes = df["Code"].value_counts()[:5].index.tolist()
top_stations = df["Station"].value_counts()[:5].index.tolist()
sns.catplot(x='Code',col='Station', data=df.loc[(df['Code'].isin(top_codes)) & (df['Station'].isin(top_stations))],
kind='count', col_wrap=5)
The above code produces the following result:

I want station names, e.g., KENNEDY BD STATION, SHEPPHARD WEST STATION, FINCH STATION to appear in alphabetical order.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
