Skip to content

Default arguments of raw.plot_psd() changed #11343

Description

@cbrnr

Description of the problem

It seems like the default arguments of raw.plot_psd() changed in MNE 1.2 (see example below).

Steps to reproduce

import mne
from mne.datasets import sample

fname = sample.data_path() / "MEG" / "sample" / "sample_audvis_raw.fif"
raw = mne.io.read_raw(fname).pick_types(eeg=True).load_data()
raw.plot_psd(fmax=60)

Link to data

No response

Expected results

Result from MNE < 1.2:

raw-plot_psd-1 1

Actual results

Result from MNE >= 1.2 (including main):

raw-plot_psd-main

Additional information

Platform: macOS-11.7.1-x86_64-i386-64bit
Python: 3.10.8 (main, Oct 13 2022, 10:18:28) [Clang 13.0.0 (clang-1300.0.29.30)]
Executable: /Users/clemens/Projects/mne-python/.direnv/python-3.10.8/bin/python
CPU: i386: 8 cores
Memory: Unavailable (requires "psutil" package)
mne: 1.3.dev0
numpy: 1.23.5 {unknown linalg bindings (threadpoolctl module not found: No module named 'threadpoolctl')}
scipy: 1.9.3
matplotlib: 3.6.2 {backend=MacOSX}

Activity

  1. self-assigned this
    on Nov 30, 2022
  2. drammock commented on Nov 30, 2022

    @drammock
    Member

    on main I see Effective window size : 0.426 (s) and on 1.1 I see Effective window size : 3.410 (s). Should be fairly easy to track down, I'll work on it.

  3. cbrnr commented on Jan 11, 2023

    @cbrnr
    ContributorAuthor

    Unfortunately, this is still not fixed on main (the minimal example still reproduces the issue). Did something go wrong with merging #11345? @drammock do you have time to investigate?

  4. reopened this on Jan 11, 2023
  5. changed the title [-]Default arguments of `raw.plot_psd()` changed?[/-] [+]Default arguments of `raw.plot_psd()` changed[/+] on Jan 11, 2023
  6. drammock commented on Jan 12, 2023

    @drammock
    Member

    Unfortunately, this is still not fixed on main (the minimal example still reproduces the issue). Did something go wrong with merging #11345? @drammock do you have time to investigate?

    @cbrnr Are you sure? I just ran

    $ git switch main
    $ git fetch upstream
    $ git merge upstream/main

    followed by

    import mne
    from mne.datasets import sample
    
    fname = sample.data_path() / "MEG" / "sample" / "sample_audvis_raw.fif"
    raw = mne.io.read_raw(fname).pick_types(eeg=True).load_data()
    raw.plot_psd(fmax=60)

    and I get this figure:

    Figure_1

  7. cbrnr commented on Jan 13, 2023

    @cbrnr
    ContributorAuthor

    That works, but

    raw.compute_psd(fmax=60).plot()

    doesn't. Since the note explicitly recommends to switch to this new variant, I'd expect them to yield identical results.

  8. drammock commented on Jan 13, 2023

    @drammock
    Member

    OK, now I see the problem. Next time when you say

    the minimal example still reproduces the issue

    please check first. The code that is problematic for you is not in the minimal example at the top of this issue.

  9. cbrnr commented on Jan 13, 2023

    @cbrnr
    ContributorAuthor

    Sorry about that, I missed that line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions