fooof.plts.fm.plot_fm

fooof.plts.fm.plot_fm(fm, plot_peaks=None, plot_aperiodic=True, freqs=None, power_spectrum=None, freq_range=None, plt_log=False, add_legend=True, save_fig=False, file_name=None, file_path=None, 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 FOOOF object.

Parameters
fmFOOOF

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.

save_figbool, optional, default: False

Whether to save out a copy of the plot.

file_namestr, optional

Name to give the saved out file.

file_pathPath or str, optional

Path to directory to save to. If None, saves to current directory.

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

Since FOOOF objects store power values in log spacing, the y-axis (power) is plotted in log spacing by default.