I have the name of the day of the week on the x-axis of my seaborn scatterplot.
I want to order it according to the following natural order
cats = [ 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']
I tried following which is working for other plot types:
sns.scatterplot(data=df, x='Day', y='Time', hue='Type', order= cats)
But gives me an error: it seems like order is not in the scatterplot func. How to solve this?
File "/..lib/python3.7/site-packages/matplotlib/artist.py", line 970, in _update_property
.format(type(self).__name__, k))
AttributeError: 'PathCollection' object has no property 'order'
Copyright Notice:Content Author:「Malintha」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/64769301/seaborn-scatterplot-order-the-x-axis-lables