ENH: add cmap parameter to Evoked.animate_topomap#13756
Open
HansujaB wants to merge 5 commits intomne-tools:mainfrom
Open
ENH: add cmap parameter to Evoked.animate_topomap#13756HansujaB wants to merge 5 commits intomne-tools:mainfrom
HansujaB wants to merge 5 commits intomne-tools:mainfrom
Conversation
|
Hello! 👋 Thanks for opening your first pull request here! ❤️ We will try to get back to you soon. 🚴 |
for more information, see https://pre-commit.ci
…ujaB/mne-python into add_cmap_to_animate_topomap
for more information, see https://pre-commit.ci
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Reference issue
Fixes #12418
What does this implement/fix?
This PR adds a cmap parameter to Evoked.animate_topomap, allowing users to specify the colormap used for the animated topomap. Previously the colormap was chosen internally based on the data (e.g., "Reds" or "RdBu_r"), and users could not override it.
The new parameter brings the API closer to plot_topomap, which already supports a cmap argument.
Additional information
If cmap=None, the previous default behavior is preserved.
The parameter is passed through to the internal animation functions so that the specified colormap is used when rendering the topomap.
A new test has been added to verify that:
-> The default behavior still works
-> A custom colormap (e.g., "viridis") is correctly applied.
To Discuss
plot_topomap exposes several additional parameters (e.g., cnorm, colorbar, etc.) that are not currently available in Evoked.animate_topomap. If it would be useful, I would be happy to extend the animation API to support some of these parameters in follow-up PRs.