specparam.plts.model.plot_model¶
- specparam.plts.model.plot_model(model, plot_peaks=None, plot_aperiodic=True, freqs=None, power_spectrum=None, freq_range=None, plt_log=False, add_legend=True, ax=None, data_kwargs=None, model_kwargs=None, aperiodic_kwargs=None, peak_kwargs=None, **plot_kwargs)[source]¶
Plot the power spectrum and model fit results from a model object.
- Parameters:
- modelSpectralModel
Object containing a power spectrum and (optionally) results from fitting.
- plot_peaksNone or {‘shade’, ‘dot’, ‘outline’, ‘line’}, optional
What kind of approach to take to plot peaks. If None, peaks are not specifically plotted. Can also be a combination of approaches, separated by ‘-’, for example: ‘shade-line’.
- plot_aperiodicboolean, optional, default: True
Whether to plot the aperiodic component of the model fit.
- freqs1d array, optional
Frequency values of the power spectrum to plot, in linear space. If provided, this overrides the values in the model object.
- power_spectrum1d array, optional
Power values to plot, in linear space. If provided, this overrides the values in the model object.
- freq_rangelist of [float, float], optional
Frequency range to plot, defined in linear space.
- plt_logboolean, optional, default: False
Whether to plot the frequency values in log10 spacing.
- add_legendboolean, optional, default: False
Whether to add a legend describing the plot components.
- axmatplotlib.Axes, optional
Figure axes upon which to plot.
- data_kwargs, model_kwargs, aperiodic_kwargs, peak_kwargsNone or dict, optional
Keyword arguments to pass into the plot call for each plot element.
- **plot_kwargs
Additional plot related keyword arguments, with styling options managed by
style_plot
.
Notes
The y-axis (power) is plotted in log spacing by default.