trevismd / statannotations

add statistical significance annotations on seaborn plots. Further development of statannot, with bugfixes, new features, and a different API.
Other
624 stars 67 forks source link

Mixing up of pairs with pvalues; boxplot with hues #45

Closed autobot101 closed 2 years ago

autobot101 commented 2 years ago

Hi, When plotting a boxplot with hues, I have certain pairs and a list of pvalues, in which values are in the same order as pairs order. But, after plotting, the pairs are getting assigned with different pvalues, not following the assigned order. This problem only happens when I use set_custom_annotations but when using set_pvalues, the order of pairs and pvalues are okay. I am trying to understand why this is happening, does the pairs get sorted and then the pvalues are assigned to them? Any insights will be helpful. Thanks

trevismd commented 2 years ago

Hello, Thanks for reporting this! You are right all the way, since the order of boxes is determined by the (original) plotter, and given pairs can be in any order. So, there are some steps that do re-arrange the given pvalues, and that were not used for custom annotations. I'll push a fix into the dev branch very shortly.

trevismd commented 2 years ago

@Anuragksingh , you can try it out, if you want!

autobot101 commented 2 years ago

Thanks for the prompt reply. I will try this out.