neurodsp.plts.plot_swm_pattern¶
- neurodsp.plts.plot_swm_pattern(pattern, ax=None, **kwargs)[source]¶
Plot the resulting pattern from a sliding window matching analysis.
- Parameters
- pattern1d array
The resulting average pattern from applying sliding window matching.
- axmatplotlib.Axes, optional
Figure axes upon which to plot.
- **kwargs
Keyword arguments for customizing the plot.
Examples
Plot the average pattern from a sliding window matching analysis:
>>> import numpy as np >>> from neurodsp.sim import sim_combined >>> from neurodsp.rhythm import sliding_window_matching >>> sig = sim_combined(n_seconds=10, fs=500, ... components={'sim_powerlaw': {'f_range': (2, None)}, ... 'sim_bursty_oscillation': {'freq': 20, ... 'enter_burst': .25, ... 'leave_burst': .25}}) >>> windows, _ = sliding_window_matching(sig, fs=500, win_len=0.05, win_spacing=0.5) >>> avg_window = np.mean(windows) >>> plot_swm_pattern(avg_window)
Examples using neurodsp.plts.plot_swm_pattern
¶
Sliding Window Matching