Skip to content

ENH: Improve report plotting and animate_topomap#13905

Open
larsoner wants to merge 7 commits into
mne-tools:mainfrom
larsoner:report
Open

ENH: Improve report plotting and animate_topomap#13905
larsoner wants to merge 7 commits into
mne-tools:mainfrom
larsoner:report

Conversation

@larsoner
Copy link
Copy Markdown
Member

I don't like how long it takes to generate reports, so I was trying to speed it up a bit. In doing so, I realized animate_topomap wasn't working properly, and refactored it to reuse plot_evoked_topomap code. This makes it more feature-complete, and I fixed its behavior (with both blit=True and blit=False). I also made it so the report now has butterfly=True from the animate_topomap, which I think is nice. From this testing code:

MWE
import mne

sample_dir = mne.datasets.sample.data_path() / "MEG" / "sample"
evoked_path = sample_dir / "sample_audvis-ave.fif"
cov_path = sample_dir / "sample_audvis-cov.fif"

evokeds = mne.read_evokeds(evoked_path, baseline=(None, 0))
#fig, anim = evokeds[0].animate_topomap(butterfly=True, frame_rate=2)
report = mne.Report()
report.add_evokeds(
    evokeds=evokeds[:1],
    n_time_points=20,
)
report.save("report_evoked.html", overwrite=True, open_browser=True)

You can see it:

image

I expect some test breakages, will push fixes for those.

@larsoner larsoner marked this pull request as ready for review May 21, 2026 17:17
@larsoner
Copy link
Copy Markdown
Member Author

blit=False is no longer needed for the example to render properly (compare to main, where it is needed, and doesn't look as good / consistent with evoked.plot_topomap).

Ready for review/merge from my end!

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.

1 participant