ENH: Add TimeChange behaviour to plot_evoked#14025
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds TimeChange UI-event integration to mne.viz.plot_evoked() (and therefore Evoked.plot()), enabling evoked plots to both publish time changes on click and react to externally-published time changes by updating a vertical time marker.
Changes:
- Publish
TimeChangeevents from evoked butterfly plots on mouse click. - Subscribe evoked plots to
time_changeevents and move/update a vertical selection marker accordingly. - Add/extend tests to cover click-driven time selection and
TimeChangeevent handling.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| mne/viz/evoked.py | Publishes and subscribes to TimeChange events; adds time-marker updates in evoked plots. |
| mne/viz/tests/test_evoked.py | Adds tests ensuring click selection creates a marker and TimeChange updates it. |
|
It works, but the current UI feels a little brittle, with selecting a channel or selecting a time range also moving the time cursor. Would it be possible to have the following behavior?
|
No problem, I will look into them. |
Co-authored-by: Marijn van Vliet <w.m.vanvliet@gmail.com>
Reference issue (if any)
Implements #14024.
What does this implement/fix?
Adds
TimeChangebehaviour inmne.viz.plot_evoked(), which is the underlying function formne.Evoked.plot()too.Additional information