I have a dataset with 'Counts' from several 'Items' per animal, for totally 291 animals.
The data has been acquired at days 4, 10,21 and 60, an (edited) df.to_dense()
looks like this
Animal Day Item Counts
0 04A 4 11 11
1 04A 4 12 6
2 04A 4 16 26
3 04A 4 20 28
4 04A 4 21 16
[...]
286 60C 60 18 43
287 60C 60 20 69
288 60C 60 21 93
289 60C 60 23 55
290 60C 60 24 114
I would like to plot the data nicely, with seaborn.
For this I do sns.boxplot(data=df, x='Day', y='Counts')
which gives me the plot below.
Now I'd like to show the boxplots for the single animals and thought to just add the 'hue' parameter, like so: sns.boxplot(data=df, x='Day', y='Counts', hue='Animal')
.
The values are now nicely grouped, as I would have expected it, but they are not really aligned to the x-label.
Maye I understand the hue
parameter wrong, but I'd like to split the day-points into the different animals and show them (center-)aligned to the x-label.
Any tips on how to achieve this?