From fc2434d1ee24672ba67a16f989ca053144a99c99 Mon Sep 17 00:00:00 2001 From: kdobler Date: Tue, 17 May 2022 21:20:36 +0200 Subject: [PATCH] minor fixes --- EEGToolkit/EEGStats.py | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/EEGToolkit/EEGStats.py b/EEGToolkit/EEGStats.py index cf6d343..bb6c53b 100644 --- a/EEGToolkit/EEGStats.py +++ b/EEGToolkit/EEGStats.py @@ -341,13 +341,7 @@ def _plot_( # add the shaded fillings for significantly different # timepoint areas signif_level = kwargs.pop( "significance_level", 0.05 ) - _shade_singificant_regions( - ax, - significance_level = signif_level, - pvalues = pvalues, - xvalues = x_values, - ylim = yvalues, - ) + _shade_significant_regions(ax, significance_level=signif_level, pvalues=pvalues, xvalues=x_values, ylim=yvalues) @@ -357,7 +351,7 @@ def _plot_( # and some axes formatting... ax.set_title("Average EEG Signal (Shaded area SEM)") ax.set_ylabel("Signal\namplitude") - ax.set_xlabel("Time relative to event") + ax.set_xlabel("Time relative to event (ms)") if make_legend: handles = [ @@ -429,13 +423,8 @@ def _difference_plot_(ax, # add the shaded fillings for significantly different # timepoint areas - _shade_singificant_regions( - ax, - significance_level = significance_level, - pvalues = pvalues, - xvalues = x_values, - ylim = yvalues, - ) + _shade_significant_regions(ax, significance_level=significance_level, pvalues=pvalues, xvalues=x_values, + ylim=yvalues) # plot scaled signals 1 and 2 signal_1 = mean_1 * y_scale @@ -450,7 +439,7 @@ def _difference_plot_(ax, # and some axes formatting... ax.set_title("Average EEG Signal (Shaded area significant regions)") ax.set_ylabel("Signal\namplitude") - ax.set_xlabel("Time relative to event") + ax.set_xlabel("Time relative to event (ms)") if make_legend: # now add a custom legend @@ -476,7 +465,7 @@ def _difference_plot_(ax, ) return pvalues -def _shade_singificant_regions(ax, significance_level : float , pvalues : np.ndarray , xvalues : np.ndarray , ylim : tuple ): +def _shade_significant_regions(ax, significance_level : float , pvalues : np.ndarray , xvalues : np.ndarray , ylim : tuple ): """ Shades the background of regions (x-value ranges) where corresponding p-values are below a given significance level.