From 4d0e8aeff6fee6006337b9a698ebb8ededebcf17 Mon Sep 17 00:00:00 2001
From: Fontrodona Nicolas <nicolas.fontrodona@ens-lyon.fr>
Date: Wed, 15 Jul 2020 15:34:09 +0200
Subject: [PATCH] src/fig_utils/stat_annot.py: new parameter min_pval that
 allow to define the minimum p-value to display on the figure

---
 src/fig_utils/stat_annot.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/fig_utils/stat_annot.py b/src/fig_utils/stat_annot.py
index 092e1754..6d30ed30 100644
--- a/src/fig_utils/stat_annot.py
+++ b/src/fig_utils/stat_annot.py
@@ -26,7 +26,7 @@ def add_stat_annotation(ax, data=None, x=None, y=None, hue=None, order=None,
                         liney_offset_axes_coord=None,
                         line_height_axes_coord=0.02,
                         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, \
     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,
             if pval > 1e-16:
                 text = "p = {:.2e}".format(pval)
             else:
-                text = "p < 1e-16"
+                text = f"p < {min_pval:.0e}"
 
             if loc == 'inside':
                 y_ref = max(ymax1, ymax2)
-- 
GitLab