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.

AverageTFR.plot() only plots one channel

See original GitHub issue

Although AverageTFR.plot() has a picks argument, only the first channel is plotted. I don’t think this is by design - or is it? If so, then at least the docstring is confusing, because it explicitly mentions that None selects all good channels and "all" selects all channels.

import numpy as np
import mne


n_chans = 10
n_epochs = 100
tmin, tmax = -2, 5
fs = 256
info = mne.create_info(n_chans, fs, "eeg")
data = np.random.rand(n_epochs, n_chans, (abs(tmin) + abs(tmax)) * fs + 1)
epochs = mne.EpochsArray(data, info, tmin=tmin)

freqs = np.arange(1, 51)

tfr = mne.time_frequency.tfr_multitaper(epochs, freqs=freqs, n_cycles=freqs,
                                        average=False, return_itc=False)
tfr.average().plot()

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
eortcommented, Mar 18, 2021

Yes, that’s right. I meant in my commit. Fixing that issue of always getting exactly one figure, wIthout changing the default behaviour of picks, will lead to as many figures as you have channels.

0reactions
mmagnuskicommented, Aug 2, 2021

Seems to have been fixed by #9150.

Read more comments on GitHub >

github_iconTop Results From Across the Web

mne.time_frequency.AverageTFR — MNE 1.2.2 documentation
If list, the list must be a list of Axes of the same length as picks . If instance of Axes, there must...
Read more >
Plotting of mne.combine_evoked output based on ...
Plotting of mne.combine_evoked output based on AverageTFR input (mutiple channels) only shows TFR output of the ... AverageTFR.plot() only plots one channel.
Read more >
Viz improvement: AverageTFR.plot_joint · Issue #3801 - GitHub
If True, show only one plot: the average over all selected channels. If picks is empty, the mean over all channels is plotted....
Read more >
mne.time_frequency.AverageTFR
If not None, override default verbose level (see mne.verbose() and Logging ... If instance of Axes, there must be only one channel plotted....
Read more >
Plotting data at the channel and source level - FieldTrip toolbox
You could make the same plot by the following code, using the MATLAB plot command. selected_data = avgFC.avg(9,241 ...
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