Skip to content

ENH: Add optional channel name overlay to plot_alignment#13570

Merged
drammock merged 11 commits intomne-tools:mainfrom
aman-coder03:enh-plot-alignment-channel-names
Feb 12, 2026
Merged

ENH: Add optional channel name overlay to plot_alignment#13570
drammock merged 11 commits intomne-tools:mainfrom
aman-coder03:enh-plot-alignment-channel-names

Conversation

@aman-coder03
Copy link
Contributor

What does this PR do?

adds an optional show_channel_names parameter to plot_alignment to overlay channel labels at sensor locations in the 3D alignment view.

Why?

this improves interpretability when inspecting sensor alignment, especially for debugging, teaching, and demonstrations. The feature is fully opt-in and does not change default behavior.

Backward compatibility

fully backward compatible (disabled by default).

Tests

visualization tests pass (dataset-dependent tests skipped as expected).

fixes #13502

mne/viz/_3d.py Outdated
Comment on lines 959 to 961
xyz[0],
xyz[1],
xyz[2],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
xyz[0],
xyz[1],
xyz[2],
*xyz,

@drammock
Copy link
Member

drammock commented Jan 2, 2026

@aman-coder03 please also look at our tutorials or examples that use plot_alignment, find one where it wouldn't be distracting to include the sensor names, and change the tutorial to use this new parameter. That way we can see how it looks in the built documentation

@aman-coder03
Copy link
Contributor Author

thanks for your suggestion @drammock
I have updated the changes, happy to adjust the example if you prefer a different one.

@1himan
Copy link
Contributor

1himan commented Jan 14, 2026

Hey @aman-coder03, for describing your changes in the changelog you might wanna read this.

Also you can ping me if you need any sort of help.

@aman-coder03 aman-coder03 force-pushed the enh-plot-alignment-channel-names branch from b3694e8 to 3e575f7 Compare January 21, 2026 14:06
@drammock
Copy link
Member

https://app.circleci.com/pipelines/github/mne-tools/mne-python/30108/workflows/d057c473-bbc5-44c6-8c59-bfc4c75c5932/jobs/79016?invite=true#step-143-128_128 says:

WARNING: Docstring 'mne.viz.plot_alignment' is missing a blank line before the directive ' .. versionadded::' on line 188

The windows pip-pre failure is being tracked upstream here: statsmodels/statsmodels#9748 and we already have a work-around in #13632 so let's merge in main after addressing the doc build problem.

Copy link
Member

@drammock drammock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@drammock drammock enabled auto-merge (squash) February 12, 2026 15:53
@drammock drammock merged commit 4a5479d into mne-tools:main Feb 12, 2026
32 checks passed
@welcome
Copy link

welcome bot commented Feb 12, 2026

🎉 Congrats on merging your first pull request! 🥳 Looking forward to seeing more from you in the future! 💪

@aman-coder03
Copy link
Contributor Author

thankyouu very much @drammock for your support and guidance!!
looking forward to contribute more!!

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: Add channel names to plot_alignment

3 participants