neurodsp.plts.plot_power_spectra

neurodsp.plts.plot_power_spectra(freqs, powers, labels=None, colors=None, ax=None, **kwargs)[source]

Plot power spectra.

Parameters
freqs1d array or list of 1d array

Frequency vector.

powers1d array or list of 1d array

Power values.

labelsstr or list of str, optional

Labels for each time series.

colorsstr or list of str

Colors to use to plot lines.

axmatplotlib.Axes, optional

Figure axes upon which to plot.

**kwargs

Keyword arguments for customizing the plot.

Examples

Plot a power spectrum:

>>> from neurodsp.sim import sim_combined
>>> from neurodsp.spectral import compute_spectrum
>>> sig = sim_combined(n_seconds=10, fs=500,
...                    components={'sim_synaptic_current': {},
...                                'sim_bursty_oscillation' : {'freq': 10}},
...                    component_variances=(0.5, 1.))
>>> freqs, powers = compute_spectrum(sig, fs=500)
>>> plot_power_spectra(freqs, powers)