ENH: Adding a scale legend to plot_topo and other plotting functions
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 30/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- matplotlib, python
- Domain
- data-visualization
Research direction
Start by reading the plot_topo entry point and the related plot_evoked_topo and plot_topo_image_epochs functions to understand their unified subplot behavior. Define the scale legend's scope, placement, and interaction for each channel type before implementing; done should include legends that accurately describe the subplot scales across the targeted plotting functions.
Written by the indexing model from the issue text.
Description
Describe the new feature or enhancement
Plotting functions like plot_topo could use a scale legend to visually describe the exact scale of subplots being represented by each subplot. Something like this :

The proposed scale legend showcases the X and Y scale used by each channel type in the initial plot and also the scale for each subplot on click. The parameter could also take an input to customize where the scale legend is located with inputs such as (Left and Right) or custom location parameters.
This would potentially be a multi PR approach with the initial focus specifically for plot_topo and its different forms such as plot_evoked_topo, plot_topo_image_epochs etc.
Describe your proposed implementation
One way of implementing this would be to add the Scale Legend as a separate subplot for each channel type with specifically mapped default locations. Since plot_topo currently only works with unified=True, this would be the easiest way to implement it. This does mean a new Scale_Legend class is created in the process.
Describe possible alternatives
Another potential method is to work with a custom class created from matplotlib.legend. This does bring a unique set of complications based on how it interacts with unified=True inside plot_topo and the subplots as well. Theoretically, this method would be easier to maintain, although since it's still a custom child class it wouldn't differ by much.
Thoughts? @larsoner @agramfort @jasmainak @drammock @rob-luke
References:
- Example Image used above (Pg 35)
- Dominant language
- Python
- Stars
- 3.5k
- Forks
- 1.6k
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 100
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from mne-tools/mne-python
-
ENH
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
mne-tools/mne-python#13743 · 2 comments ·
-
ENH
Difficulty 3/5 1-2 days Newbie friendliness 68/100
mne-tools/mne-python#14318 ·
-
BUG
Difficulty 3/5 1-2 days Newbie friendliness 68/100
mne-tools/mne-python#14317 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
mne-tools/mne-python#14311 · 1 comment · 1 reaction ·
-
ENH
Difficulty 5/5 Over a week Newbie friendliness 35/100
mne-tools/mne-python#14309 · 1 comment ·
All issues in mne-tools/mne-python
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
bancolombia/sentinel#23 ·
-
test md OpenCI
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
bug client
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100