mne-tools / mne-tools/mne-python
RFC: plotting in notebooks 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
Many times (most recently in #11513) users complain / get confused about plot behavior in Jupyter Notebooks, specifically the problem of figures getting "shown" too early and having empty subplot axes (typically when pre-generating a figure w/ subplots and looping over the subplot axes). Most of our plotting functions have a show=False option which will prevent the problem, but the parameter name is really confusing and I don't think it's very well documented how it should be used/interpreted in a notebook context.
One possible option would be to change the parameter to something like delay_plotting=True so that its name better reflects what is common to notebooks and interactive console sessions --- namely that the figure won't be shown immediately when it's created. Obviously, removing show will break a lot of user code, so I'd be inclined to retain show as a @legacy alias for the new param (and warn or error if both params are provided?)
I invite other suggestions of how to address this problem.
cross-ref to #11165 where a lot of related discussion can be found
cc @sam-s
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 by reading the related discussions in #11165 and #11513, then inspect the plotting functions that expose the show=False option. Done requires an agreed API and clear notebook behavior, including how any legacy alias or conflicting parameters should be handled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- jupyter-notebook, python
- Domain
- data-visualization
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100