Clarify the behaviour of the `events` parameter of Epochs.plot
See original GitHub issueDescribe the new feature or enhancement
Since version 0.22 the default behaviour when plotting epochs with Epochs.plot() is to not show the event labels and vertical bars at the top.
- See the graph in the tutorial page for version 0.21 which used to display event info.
- See the graph in the tutorial page for version 0.22 and tutorial page for dev version which does not display event info any more.
Maybe it would help newcomers and users used to the 0.21 behaviour to show how to do it in the tutorial?
Describe your proposed implementation
Replacing: epochs.plot(n_epochs=10) by epochs.plot(events=epochs.events, n_epochs=10) in plot_10_epochs_overview.py.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
mne.Epochs — MNE 1.2.2 documentation
Reject epochs based on maximum peak-to-peak signal amplitude (PTP), i.e. the absolute difference between the lowest and the highest signal ...
Read more >Define epochs according to event order - MNE Forum
and I want to create epochs that contain three events ('Hit': 2, ''M_Hit': 7, 'OGT': 8). All three events should be contained in...
Read more >mne-python/epochs.py at main
logger.info('Multiple event values for single event times found. ' 'Keeping the first occurrence and dropping all others.') new_events = events ...
Read more >Epochs - Mainak Jas
Epochs objects are a way of representing continuous data as a collection of time-locked trials, stored in an array of shape (n_events, n_channels,...
Read more >models.word2vec – Word2vec embeddings — gensim
Set self.lifecycle_events = None to disable this behaviour. Calls to add_lifecycle_event() will not record events into self.lifecycle_events then. Parameters.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I just checked out the
maint/0.21branch and tried this “press O for options” … I don’t think I’d ever used it before, and it actually doesn’t work well at all (toggling visibility of various elements worked in the off direction but not when turning them back on, the sliders for adjusting n_channels/n_epochs both yielded IndexError…). So, what needs to be tackled (these could be separate PRs):I think actually not plotting events by default is the correct behavior, since by default
events=Noneso I take back what I said earlier; this is not a regression but rather 0.21 was doing something it shouldn’t have 😃the color change was intentional, to make
raw.plot()andepochs.plot()behave similarly and have similar defaults. The old coloring can still be achieved withevent_color='g'or so.I checked and it seems like “by default the coloring scheme is the same” (between
epochs.plot()andmne.viz.plot_events()) is still true (both use matplotlib default color cycle).The docstring does seem to be inaccurate; event numbers are above and epoch numbers below so I’m not sure what “overlap” was being avoided there.
I hadn’t noticed this before, but the “press o for options” doesn’t work at all anymore.
Seems like this is a more complicated fix than it seemed at first.