seaborn catplot ordering categories alphabetically not logically
seaborn 0.13.2, Python. I have a categorical column 'size' with values ['small', 'medium', 'large', 'xlarge'] but seaborn's catplot/barplot plots them alphabetically: large, medium, small, xlarge. I want the logical order. I tried setting the column as pandas Categorical with categories in the right order, and it works for barplot but catplot with col= still seems to use alphabetical somewhere. Also the legend order is wrong. What's the clean way to control category order across seaborn functions?
4 replies