Skip to content
This repository has been archived by the owner on Sep 12, 2022. It is now read-only.

Commit

Permalink
Merge branch 'new-modifs' into dev
Browse files Browse the repository at this point in the history
minor fixes.
  • Loading branch information
AxelGiottonini committed May 18, 2022
2 parents f110519 + 3070e77 commit 1970d4c
Showing 1 changed file with 6 additions and 17 deletions.
23 changes: 6 additions & 17 deletions EEGToolkit/EEGStats/EEGStats.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,13 +342,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)



Expand All @@ -358,7 +352,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 = [
Expand Down Expand Up @@ -430,13 +424,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
Expand All @@ -451,7 +440,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
Expand All @@ -477,7 +466,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.
Expand Down

0 comments on commit 1970d4c

Please sign in to comment.