Is there a way to change the order of the individual dots in a seaborn swarmplot within the categories? That is, I would like to sort them so that all points of the same color are bunched together and we can group them in the order blue/orange/green.
Example:
- In the figure below, Male/Thursday has: orange/blue/green/blue.
- Can we sort the points so that they appear as blue/blue/orange/green?
import seaborn as sns
# Load data
tips = sns.load_dataset("tips")
# Simplify the data
df = tips.loc[tips["size"] > 3]
# Plot
sns.swarmplot(data=df, x="sex", y="day", hue="size", size = 8)

You could use
dodgeas the docs say: