Skip to content

Commit

Permalink
update event plots to plot even with nans
Browse files Browse the repository at this point in the history
  • Loading branch information
TomDonoghue committed Mar 26, 2024
1 parent 682c4a2 commit 2698f8f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion specparam/plts/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def plot_event_model(event_model, **plot_kwargs):
figsize=plot_kwargs.pop('figsize', [10, 4 + 4 * n_bands]))
axes = cycle(axes)

xlim = [0, time_model.n_time_windows]
xlim = [0, event_model.n_time_windows]

# 01: aperiodic params
alabels = ['offset', 'knee', 'exponent'] if has_knee else ['offset', 'exponent']
Expand Down
2 changes: 1 addition & 1 deletion specparam/plts/templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ def plot_params_over_time(times, params, labels=None, title=None, colors=None,


@check_dependency(plt, 'matplotlib')
def plot_param_over_time_yshade(times, param, average='mean', shade='std', scale=1.,
def plot_param_over_time_yshade(times, param, average='nanmean', shade='nanstd', scale=1.,
color=None, ax=None, **plot_kwargs):
"""Plot parameter over time with y-axis shading.
Expand Down
4 changes: 4 additions & 0 deletions specparam/utils/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,15 @@
AVG_FUNCS = {
'mean' : np.mean,
'median' : np.median,
'nanmean' : np.nanmean,
'nanmedian' : np.nanmedian,
}

DISPERSION_FUNCS = {
'var' : np.var,
'nanvar' : np.nanvar,
'std' : np.std,
'nanstd' : np.nanstd,
'sem' : sem,
}

Expand Down

0 comments on commit 2698f8f

Please sign in to comment.