@@ -379,7 +379,7 @@ def add_results(self, fooof_result):
379
379
380
380
381
381
def report (self , freqs = None , power_spectrum = None , freq_range = None ,
382
- plt_log = False , ** plot_kwargs ):
382
+ plt_log = False , plot_full_range = False , ** plot_kwargs ):
383
383
"""Run model fit, and display a report, which includes a plot, and printed results.
384
384
385
385
Parameters
@@ -393,16 +393,26 @@ def report(self, freqs=None, power_spectrum=None, freq_range=None,
393
393
If not provided, fits across the entire given range.
394
394
plt_log : bool, optional, default: False
395
395
Whether or not to plot the frequency axis in log space.
396
+ plot_full_range : bool, default: False
397
+ If True, plots the full range of the given power spectrum.
398
+ Only relevant / effective if `freqs` and `power_spectrum` passed in in this call.
396
399
**plot_kwargs
397
400
Keyword arguments to pass into the plot method.
401
+ Plot options with a name conflict be passed by pre-pending 'plot_'.
402
+ e.g. `freqs`, `power_spectrum` and `freq_range`.
398
403
399
404
Notes
400
405
-----
401
406
Data is optional, if data has already been added to the object.
402
407
"""
403
408
404
409
self .fit (freqs , power_spectrum , freq_range )
405
- self .plot (plt_log = plt_log , ** plot_kwargs )
410
+ self .plot (plt_log = plt_log ,
411
+ freqs = freqs if plot_full_range else plot_kwargs .pop ('plot_freqs' , None ),
412
+ power_spectrum = power_spectrum if \
413
+ plot_full_range else plot_kwargs .pop ('plot_power_spectrum' , None ),
414
+ freq_range = plot_kwargs .pop ('plot_freq_range' , None ),
415
+ ** plot_kwargs )
406
416
self .print_results (concise = False )
407
417
408
418
@@ -639,12 +649,13 @@ def get_results(self):
639
649
640
650
641
651
@copy_doc_func_to_method (plot_fm )
642
- def plot (self , plot_peaks = None , plot_aperiodic = True , plt_log = False ,
643
- add_legend = True , save_fig = False , file_name = None , file_path = None ,
644
- ax = None , data_kwargs = None , model_kwargs = None ,
652
+ def plot (self , plot_peaks = None , plot_aperiodic = True , freqs = None , power_spectrum = None ,
653
+ freq_range = None , plt_log = False , add_legend = True , save_fig = False , file_name = None ,
654
+ file_path = None , ax = None , data_kwargs = None , model_kwargs = None ,
645
655
aperiodic_kwargs = None , peak_kwargs = None , ** plot_kwargs ):
646
656
647
- plot_fm (self , plot_peaks = plot_peaks , plot_aperiodic = plot_aperiodic , plt_log = plt_log ,
657
+ plot_fm (self , plot_peaks = plot_peaks , plot_aperiodic = plot_aperiodic , freqs = freqs ,
658
+ power_spectrum = power_spectrum , freq_range = freq_range , plt_log = plt_log ,
648
659
add_legend = add_legend , save_fig = save_fig , file_name = file_name ,
649
660
file_path = file_path , ax = ax , data_kwargs = data_kwargs , model_kwargs = model_kwargs ,
650
661
aperiodic_kwargs = aperiodic_kwargs , peak_kwargs = peak_kwargs , ** plot_kwargs )
0 commit comments