Skip to content

ENH: Route evoked.plot() through MNELineFigure#13795

Open
PragnyaKhandelwal wants to merge 3 commits intomne-tools:mainfrom
PragnyaKhandelwal:fix-evoked-mpl-figure-13747
Open

ENH: Route evoked.plot() through MNELineFigure#13795
PragnyaKhandelwal wants to merge 3 commits intomne-tools:mainfrom
PragnyaKhandelwal:fix-evoked-mpl-figure-13747

Conversation

@PragnyaKhandelwal
Copy link
Copy Markdown
Contributor

Reference issue (if any)
Closes #13747
Related to #7751

What does this implement/fix?
When evoked.plot() creates its own figure (axes=None), it now routes through _line_figure() to instantiate MNELineFigure instead of a plain Matplotlib figure.

This aligns the default 2D plotting path with the refactor direction discussed in #7751, while keeping behavior unchanged when users pass custom axes.

Scope is intentionally limited:

evoked.plot_white() is out of scope
evoked.plot_joint() is out of scope
A regression test was added to assert MNELineFigure instantiation for the default evoked.plot() path.

Additional information
This is a localized, backward-compatible enhancement intended as an incremental step toward #7751, not a full closure of that broader refactor.

When evoked.plot() creates its own figure (axes=None), now routes through
_line_figure() to instantiate MNELineFigure instead of a plain matplotlib
figure. This aligns with the 2D plotting figure-class refactor direction
discussed in mne-tools#7751.

Behavior unchanged for custom axes. Both plot_white() and plot_joint()
remain out of scope here.

Adds regression test to assert MNELineFigure instantiation for default path.
Closes mne-tools#13747
@PragnyaKhandelwal PragnyaKhandelwal marked this pull request as ready for review March 29, 2026 10:19
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.

VIZ: evoked.plot() still bypasses MNELineFigure path (related to #7751)

1 participant