trevismd / statannotations

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

How to hide "ns" annotation #114

Closed XuanhaoYang closed 1 year ago

XuanhaoYang commented 1 year ago

Hello, I don't want to show "ns" in the plot, can I use any paramater to hide "ns"? Juts showing "*" is fit for me. Thanks!

trevismd commented 1 year ago

Hello! Please see #110.

XuanhaoYang commented 1 year ago

Hello! Please see #110.

annotator =  Annotator(ax,pairs, data=df, x="gene",y="expression",hue="type",hide_non_significant=True)
annotator.configure(test='Mann-Whitney', text_format='star',line_width=0)
annotator.apply_and_annotate()

Did I make it right? I used hide_non_significant=True but still got "ns".

trevismd commented 1 year ago

This is correct. If you did install the package from the tip of the dev branch (commit 9b7f5811a53e623fdc4ed6f8f938f3036294deb8), could you please provide a minimal but complete reproducible example of the code leading to the unexpected result?

XuanhaoYang commented 1 year ago

This is correct. If you did install the package from the tip of the dev branch (commit 9b7f581), could you please provide a minimal but complete reproducible example of the code leading to the unexpected result?

Sorry, I just use the command pip install statannotations to install the package. I don't know what do you mean by install the package from the tip of the dev branch (commit https://github.com/trevismd/statannotations/commit/9b7f5811a53e623fdc4ed6f8f938f3036294deb8). How can I install the dev branch? Thanks.

Kzra commented 1 year ago

Hi @XuanhaoYang, If you just ran pip install statannotations then you won't have the dev branch version of the package.

Try uninstalling your version of the package with pip uninstall statannotations and then reinstalling the latest version of the package from the dev branch. If you have git installed than you can run pip install git+https://github.com/trevismd/statannotations.git@dev to do this.

With the dev branch version, you will be able to hide non significant p values. You will need to restart the Python kernel to see this change take effect. Hope this helps.

trevismd commented 9 months ago

For posterity, use .configure(hide_non_significant=True) from v.0.6.0.