neurodsp.plts.plot_spectra_3d¶
- neurodsp.plts.plot_spectra_3d(freqs, powers, log_freqs=False, log_powers=True, colors=None, orientation=(20, -50), zoom=1.0, ax=None, **kwargs)[source]¶
Plot a series of power spectra in a 3D plot.
- Parameters:
- freqs1d or 2d array or list of 1d array
Frequency vector.
- powers2d array or list of 1d array
Power values.
- log_freqsbool, optional, default: False
Whether to plot the frequency values in log10 space.
- log_powersbool, optional, default: True
Whether to plot the power values in log10 space.
- colorsstr or list of str, optional
Colors to use to plot lines.
- orientationtuple of int, optional, default: (20, -50)
Orientation to set the 3D plot. See Axes3D.view_init for more information.
- zoomfloat, optional, default: 1.0
Zoom scaling for the figure axis. See Axes3D.set_box_aspect for more information.
- axmatplotlib.Axes, optional
Figure axes upon which to plot. Must be a 3D axis.
- **kwargs
Keyword arguments for customizing the plot.
Examples
Plot power spectra in 3D:
>>> from neurodsp.sim import sim_combined >>> from neurodsp.spectral import compute_spectrum >>> sig1 = sim_combined(n_seconds=10, fs=500, ... components={'sim_powerlaw': {'exponent' : -1}, ... 'sim_bursty_oscillation' : {'freq': 10}}) >>> sig2 = sim_combined(n_seconds=10, fs=500, ... components={'sim_powerlaw': {'exponent' : -1.5}, ... 'sim_bursty_oscillation' : {'freq': 10}}) >>> freqs1, powers1 = compute_spectrum(sig1, fs=500) >>> freqs2, powers2 = compute_spectrum(sig2, fs=500) >>> plot_spectra_3d([freqs1, freqs2], [powers1, powers2])