Repository navigation
ENH: Add scalings and units to plot_compare_evokeds (#8556) - #14534
Merged
larsoner merged 1 commit intoNov 17, 2026
Merged
Conversation
ishaaaan17
requested review from
agramfort,
drammock and
larsoner
as code owners
November 13, 2026 13:13
ishaaaan17
force-pushed
the
enh/plot-compare-evokeds-scalings
branch
3 times, most recently
from
November 15, 2026 13:08
b81f606 to
23153d1
Compare
Add scalings and units parameters to mne.viz.plot_compare_evokeds to allow custom units and scaling (e.g. for z-scored or decoded data), matching the convention in mne.viz.plot_evoked.
ishaaaan17
force-pushed
the
enh/plot-compare-evokeds-scalings
branch
from
November 15, 2026 13:27
23153d1 to
f0f4b8d
Compare
Member
|
Thanks @ishaaaan17 ! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
what does this implement/fix?
fixes #8556. (also addresses item 3 under static time series in the 2D plotting RFC #7751).
before this,
mne.viz.plot_compare_evokedshad these two lines hardcoded:so when the evoked data was already converted to custom scores, z-scores, regression beta weights or normalized ERPs,
plot_compare_evokedsstill used the default channel scalings (for example 10⁶ for EEG) and labeled the y-axis with µV or fT.this PR adds the parameters
scalingsandunitstoplot_compare_evokeds, likemne.viz.plot_evokedhas. both default toNone, so nothing changes for existing code. they are also passed on correctly when there are several channel types, and in the click windows ofaxes="topo".verification
mne/viz/tests/test_evoked.py::test_plot_compare_evokeds, which cover:scalings=dict(eeg=1.0)) and units (units=dict(eeg="AU")), which rescales the y-data and changes the axis label.picks=Nonepath that combines channels (GFP/RMS) with custom scalings.pytest mne/viz/tests/test_evoked.py -k test_plot_compare_evokeds) andruff checkpass.additional information
this implementation was developed with Google DeepMind agentic tools, and reviewed and refined with Muse. i checked it myself: the scaling resolution logic through
_handle_default, how the settings are passed through multiple channel types, and i ran the test suite locally before submitting.