Skip to content
Snippets Groups Projects
Commit 4d0e8aef authored by nfontrod's avatar nfontrod
Browse files

src/fig_utils/stat_annot.py: new parameter min_pval that allow to define the...

src/fig_utils/stat_annot.py: new parameter min_pval that allow to define the minimum p-value to display on the figure
parent 721ea805
Branches
No related tags found
No related merge requests found
...@@ -26,7 +26,7 @@ def add_stat_annotation(ax, data=None, x=None, y=None, hue=None, order=None, ...@@ -26,7 +26,7 @@ def add_stat_annotation(ax, data=None, x=None, y=None, hue=None, order=None,
liney_offset_axes_coord=None, liney_offset_axes_coord=None,
line_height_axes_coord=0.02, line_height_axes_coord=0.02,
text_y_offset_points=1, color='0.2', linewidth=1.5, text_y_offset_points=1, color='0.2', linewidth=1.5,
fontsize='medium', verbose=1): fontsize='medium', verbose=1, min_pval = 1e-16):
""" """
User should use the same argument for the data, x, y, hue, order, \ User should use the same argument for the data, x, y, hue, order, \
hue_order as the seaborn boxplot function. hue_order as the seaborn boxplot function.
...@@ -135,7 +135,7 @@ def add_stat_annotation(ax, data=None, x=None, y=None, hue=None, order=None, ...@@ -135,7 +135,7 @@ def add_stat_annotation(ax, data=None, x=None, y=None, hue=None, order=None,
if pval > 1e-16: if pval > 1e-16:
text = "p = {:.2e}".format(pval) text = "p = {:.2e}".format(pval)
else: else:
text = "p < 1e-16" text = f"p < {min_pval:.0e}"
if loc == 'inside': if loc == 'inside':
y_ref = max(ymax1, ymax2) y_ref = max(ymax1, ymax2)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment