Skip to content

Conversation

@shruti423
Copy link

This PR enhances the times parameter in plot_evoked_joint (and effectively plot_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:

  1. Exact peak count: times={"peaks": 5} (finds 5 peaks over the whole epoch).
  2. Specific time windows: times={"peaks": [(0.0, 0.1), (0.3, 0.5)]} (finds one peak per window).

I modified mne/viz/utils.py to handle the dictionary logic inside _process_times, ensuring internal consistency across both plotting functions as suggested by @drammock.

Checklist

  • Documentation updated (updated docstring in evoked.py with new usage and np.linspace hint).
  • New tests added (added test_plot_joint_times_dict in test_evoked.py).
  • Existing tests passed (ran test_evoked.py, and utils.py locally).

Related Issue

Fixes #13289

@shruti423 shruti423 force-pushed the enh-13289-peaks-dict branch from 38da269 to 2c0734b Compare January 5, 2026 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ENH: make times parameter of plot_evoked_joint more versatile

1 participant