statannotations icon indicating copy to clipboard operation
statannotations copied to clipboard

Mismatch betwen in the order of plotted data and annotations

Open mfvd opened this issue 1 year ago • 2 comments

Hi!

When reordering conditions on the x-axis in a seaborn boxplot using order=conditions, I get a mismatch between the plotted data and statannotations. Significance values are misplaced and assigned to the "original" order of the labels and not according to the reordered plotting of the data and x-axis labels. Not sure if this is a bug or if I'm missing something.

Any idea on how to solve this?

mfvd avatar Sep 12 '24 16:09 mfvd

You have to add order=conditions to the Annotator call.

One caveat though is that custom annotations where you've dropped non-significant values have still failed for me with the custom reordering.

mattrussell2 avatar Oct 11 '24 12:10 mattrussell2

Thanks!

mfvd avatar Oct 11 '24 14:10 mfvd