fooof icon indicating copy to clipboard operation
fooof copied to clipboard

Bug report: tutorial about Example Power Spectra and Models

Open MrCCecho opened this issue 1 year ago • 1 comments

When I follow the tutorial in following website: https://fooof-tools.github.io/fooof/auto_tutorials/plot_01-ModelDescription.html#sphx-glr-auto-tutorials-plot-01-modeldescription-py

fm1 = FOOOF(min_peak_height=0.05, verbose=False) fm2 = FOOOF(min_peak_height=0.05, aperiodic_mode='knee', verbose=False) fm1.fit(freqs1, powers1) fm2.fit(freqs2, powers2)

Plot one of the example power spectra

plot_spectra(freqs1, powers1, log_powers=False, color='black') I found the warning about this ValueError: x and y must have same first dimension, but have shapes (75,) and (1,)

But the data structure is true, and I can plot the PSD in the plt.plot from matplotlib toolbox... So I want to know why this warning is happen...

MrCCecho avatar Jan 06 '24 12:01 MrCCecho

Hey @MrCCecho - are you on fooof v1.0 by any chance? I think what might be happening is that the documentation website has been updated for version 1.1, which included some updates to plotting that are leading to the issue you are experiencing. This should be fixed by updating to fooof version 1.1 (if you are on a terminal pip install -U fooof should work to update, for example)

TomDonoghue avatar Feb 16 '24 01:02 TomDonoghue

As far as I can tell, this issue is about the documentation site reflecting v1.1, which is slightly different if you are running 1.0. If anyone else encounters a similar issue here, you are recommended to update to v1.1. Otherwise, since I don't think there is an action item here, I am going to close this issue - but if @MrCCecho or anyone else has any follow up, feel free to add a comment, etc!

TomDonoghue avatar Mar 25 '24 16:03 TomDonoghue