Skip to content

Conversation

@mscheltienne
Copy link
Member

As reported on the forum here.

To reproduce:

import numpy as np

import mne
from mne.datasets import sample
from mne.time_frequency import tfr_morlet

data_path = sample.data_path()
raw_fname = sample.data_path() / "MEG" / "sample" / "sample_audvis_raw.fif"

# Setup for reading the raw data
raw = mne.io.read_raw_fif(raw_fname, preload=False)
# crop and resample just to reduce computation time
raw.crop(120, 200).load_data().resample(200)
events = mne.find_events(raw, stim_channel="STI 014")

# picks MEG gradiometers
picks = mne.pick_types(raw.info, meg="grad", eeg=True, eog=True, stim=False)

# Construct Epochs
event_id, tmin, tmax = 1, -1.0, 3.0
epochs = mne.Epochs(
    raw,
    events,
    event_id,
    tmin,
    tmax,
    picks=picks,
    baseline=(None, 0),
    reject=dict(grad=4000e-13, eog=350e-6),
    preload=True,
)

freqs = np.logspace(*np.log10([6, 35]), num=8)
n_cycles = freqs / 2.0  # different number of cycle per frequency
power, itc = tfr_morlet(
    epochs,
    freqs=freqs,
    n_cycles=n_cycles,
    use_fft=True,
    return_itc=True,
    decim=3,
    n_jobs=None,
)

power.plot_topo(baseline=(-0.5, 0), mode="logratio", title="Average power")

And then click and select as on the initial post on the forum.

It's due to the deprecation in #11371.

@drammock
Copy link
Member

drammock commented May 9, 2023

tested locally with the MWE, seems to work fine. Thanks @mscheltienne for cleaning up things I missed 🙈

@drammock drammock merged commit d2600ee into mne-tools:main May 9, 2023
@mscheltienne mscheltienne deleted the fix-plot-topo branch May 9, 2023 14:38
larsoner added a commit to larsoner/mne-python that referenced this pull request May 18, 2023
* upstream/main: (32 commits)
  MAINT: Update download buttons [skip azp] [skip actions] [skip cirrus]
  Fix canvas.draw() in callback (mne-tools#11697)
  Remove recursion in plot_ica_components and use context manager for plt.ion/plt.ioff (mne-tools#11696)
  Update affiliation (mne-tools#11695)
  BUG: Fix bug with fwd restriction (mne-tools#11694)
  MRG: Suggest using "conda rename" in MNE updating instructions (mne-tools#11692)
  FIX: Regex [ci skip]
  MAINT: Apply deprecations [circle deploy] (mne-tools#11687)
  MAINT: Release 1.4.0 (mne-tools#11686)
  Trap music (mne-tools#11679)
  Fix call to plot_tfr_topomap from interactive AverageTFR.plot_topo function (mne-tools#11683)
  silence spectrum plot warning in examples/tutorials [circle full] (mne-tools#11682)
  Spectrum plot picks (mne-tools#11680)
  Update website conf (mne-tools#11675)
  BUG: Fix bug with MF LCMV rank (mne-tools#11664)
  ENH: Change known_config_types to dict (mne-tools#11166)
  MAINT: Improve README (mne-tools#11673)
  MAINT: Add to git-blame-ignore-revs [circle front]
  MAINT: Run black on codebase
  MAINT: Use black
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants