ENH: Allow dict for times in plot_evoked_joint(#13289) #13573
+76
−1
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.
This PR enhances the
timesparameter inplot_evoked_joint(and effectivelyplot_topomap) to accept a dictionary, addressing issue #13289.Previously,
times="peaks"hardcoded the search to 3 peaks over the full epoch. This update allows users to specify:times={"peaks": 5}(finds 5 peaks over the whole epoch).times={"peaks": [(0.0, 0.1), (0.3, 0.5)]}(finds one peak per window).I modified
mne/viz/utils.pyto handle the dictionary logic inside_process_times, ensuring internal consistency across both plotting functions as suggested by @drammock.Checklist
evoked.pywith new usage andnp.linspacehint).test_plot_joint_times_dictintest_evoked.py).test_evoked.py, andutils.pylocally).Related Issue
Fixes #13289