question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Epochs.plot_psd_topomap() doesn't apply unit scaling

See original GitHub issue

Epochs.plot_psd does scale the measurement units while Epochs.plot_psd_topomap doesn’t, causing confusion

import os.path as op
import mne
from mne.datasets import somato

data_path = somato.data_path()
subject = '01'
task = 'somato'
raw_fname = op.join(data_path, 'sub-{}'.format(subject), 'meg',
                    'sub-{}_task-{}_meg.fif'.format(subject, task))

raw = mne.io.read_raw_fif(raw_fname)
events = mne.find_events(raw, stim_channel='STI 014')

picks = mne.pick_types(raw.info, meg='grad', eeg=False, eog=True, stim=False)
event_id, tmin, tmax = 1, -1., 3.
baseline = (None, 0)
epochs = mne.Epochs(raw, events, event_id, tmin, tmax, picks=picks,
                    baseline=baseline, reject=dict(grad=4000e-13, eog=350e-6),
                    preload=True)

epochs.resample(200., npad='auto')  # resample to reduce computation time

fmin = 0.1
fmax = 40

epochs.plot_psd(fmin=fmin, fmax=fmax, average=True, dB=True, area_mode=None)
epochs.plot_psd_topomap(dB=True)

a

b

The displayed data have a scale difference of precisely 13 orders of magnitude.

cc @cbrnr @guiomar

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

2reactions
guiomarcommented, Oct 20, 2021

Thnaks a lot @hoechenberger for the super quick fix!! And @cbrnr for the discussions!!

1reaction
cbrnrcommented, Oct 20, 2021

Let’s first discuss if people would like to see this changed. I have several things that I need to finish in the next days, so currently I do not want to take on new tasks right now (but maybe next week or the week after).

Read more comments on GitHub >

github_iconTop Results From Across the Web

mne.viz.plot_epochs_psd_topomap - MNE-Python
LEGACY: New code should use Epochs.compute_psd().plot_topomap(). Plot the topomap of the power spectral density across epochs. Parameters:.
Read more >
RFC: consistent API for topomap plotting · Issue #11032 - GitHub
In working on the API / implementation of .plot_topomap() for the new Spectrum class, I went to our existing API for inspiration.
Read more >
Segmentation into ERP epochs
subplots() allows us to specify the figure size. Note that when we run the MNE plot command, we don't apply a Matplotlib axis...
Read more >
mne.Evoked — MNE 0.15.dev0 documentation
If not None, override default verbose level (see mne.verbose() and Logging ... ylim for plots (after scaling has been applied).
Read more >
Plot tomomap in epochs - Support & Discussions - MNE Forum
... I want to do topomap for my epochs but I don't need to use ... you can plot topomaps of evoked data...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found