mne-tools / mne-tools/mne-python
Interactive plots with show=False
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 3.5k
- Forks
- 1.6k
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 100
Description
Interactive plots with show=False or with non blocking matlabplot backends can lead to unexpected results.
For instance (here is gist showing this for sample data - https://gist.github.com/bloyl/7f6a7910bf2afce5f198b6233f39416b )
evoked.info['bads'] = []
evoked.plot(exclude=[], show=False)
evoked.info['bads'] += [new_bad_chans]
evoked,.plot(exclude=[],show=False)
plt.show()
This will make 2 figures. the Butterfly plots will be correct, the first will show no bad channels and the second will show the bads chans in red.
However if you select a time range from either plot you will see a topomap created using on the 'good' channels of evoked. This is unexpected for 2 reasons.
- exclude=[] should use all the channels. Maybe indicating bad channels somehow.
- in figure 1, the topomap doesn't match the butterfly plot because the data used to make it changed but only the interactive part (the topomap) saw that change.
This is understandably a corner case and not a high priority but I wanted it listed so I don't completely forget about it :)
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.
Research direction
Start with the linked gist and reproduce the shown evoked.plot(..., show=False) sequence, including the later mutation of evoked.info['bads'] and plt.show(). Trace how the interactive topomap obtains channel state from each figure. Done means non-blocking plots keep consistent data and apply exclude=[] as described.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- matplotlib, python
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100