diff --git a/pyproject.toml b/pyproject.toml index a4a4713..6390bce 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,8 +19,9 @@ classifiers = [ dependencies = [ "numpy", "pandas", - "seaborn", - "statannotations", + "seaborn"="0.11.2", + "matplotlib"="3.8.4" + "statannotations=0.6.0", "scipy" ] diff --git a/swarm_visualizer/utility/statistics_utils.py b/swarm_visualizer/utility/statistics_utils.py index cb9f772..9d7fa5a 100644 --- a/swarm_visualizer/utility/statistics_utils.py +++ b/swarm_visualizer/utility/statistics_utils.py @@ -10,13 +10,17 @@ def add_wilcoxon_value( hue=None, order_list=None, box_pairs=None, - test_type=None, - text_format=None, + test_type="Wilcoxon", + text_format="full", loc=None, fontsize=20, verbose=0, + pvalue_format_string="{:.4f}", + show_test_name=False, + **kwargs ) -> None: annotator = Annotator(ax,box_pairs,data=df, x=x_var, y=y_var, hue = hue, order=order_list) - annotator.configure(test=test_type, text_format=text_format, loc=loc, verbose=verbose, fontsize=fontsize) + annotator.configure(test=test_type, text_format=text_format, loc=loc, verbose=verbose, fontsize=fontsize, + pvalue_format_string=pvalue_format_string, show_test_name=show_test_name, **kwargs) annotator.apply_and_annotate() diff --git a/tests/test_p_value.py b/tests/test_p_value.py index 61ccf65..acbf166 100644 --- a/tests/test_p_value.py +++ b/tests/test_p_value.py @@ -8,8 +8,7 @@ import pytest from swarm_visualizer import plot_grouped_boxplot, plot_paired_boxplot -from swarm_visualizer.utility import save_fig, set_plot_properties -from swarm_visualizer.utility import add_wilcoxon_value +from swarm_visualizer.utility import save_fig, set_plot_properties, add_wilcoxon_value # Example Plots location _X1_DATA = np.arange(0, 5, 0.05) + np.random.normal(0, 0.1, 100)