Skip to content

Commit 2698f8f

Browse files
committed
update event plots to plot even with nans
1 parent 682c4a2 commit 2698f8f

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

specparam/plts/event.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def plot_event_model(event_model, **plot_kwargs):
5454
figsize=plot_kwargs.pop('figsize', [10, 4 + 4 * n_bands]))
5555
axes = cycle(axes)
5656

57-
xlim = [0, time_model.n_time_windows]
57+
xlim = [0, event_model.n_time_windows]
5858

5959
# 01: aperiodic params
6060
alabels = ['offset', 'knee', 'exponent'] if has_knee else ['offset', 'exponent']

specparam/plts/templates.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ def plot_params_over_time(times, params, labels=None, title=None, colors=None,
289289

290290

291291
@check_dependency(plt, 'matplotlib')
292-
def plot_param_over_time_yshade(times, param, average='mean', shade='std', scale=1.,
292+
def plot_param_over_time_yshade(times, param, average='nanmean', shade='nanstd', scale=1.,
293293
color=None, ax=None, **plot_kwargs):
294294
"""Plot parameter over time with y-axis shading.
295295

specparam/utils/data.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,15 @@
1515
AVG_FUNCS = {
1616
'mean' : np.mean,
1717
'median' : np.median,
18+
'nanmean' : np.nanmean,
19+
'nanmedian' : np.nanmedian,
1820
}
1921

2022
DISPERSION_FUNCS = {
2123
'var' : np.var,
24+
'nanvar' : np.nanvar,
2225
'std' : np.std,
26+
'nanstd' : np.nanstd,
2327
'sem' : sem,
2428
}
2529

0 commit comments

Comments
 (0)