matplotlib / matplotlib/ipympl
PolygonSelector does not work in JupyterLab
Nobody has claimed this yet.
- Dominant language
- Jupyter Notebook
- Stars
- 1.7k
- Forks
- 234
- PR merge metrics
- No merged PRs in 30d
Description
## Describe the issue
The PolygonSelector example from the [mpl docs](https://matplotlib.org/stable/gallery/widgets/polygon_selector_demo.html) works very well in the default Qt backend.

However, using `ipympl` in a notebook, nothing happens. No gray point follows the mouse cursor, nothing is drawn when I click. Just the initial figure with the blue dots.
I checked the jupyterlab log console on debug level but there are no errors.
I was wondering if it was related to https://github.com/matplotlib/matplotlib/issues/15852, and tried adding `useblit=False` where the `PolygonSelector` is created, but this did not help.
## Versions
- jupyterlab = 3.4.2
- ipympl = 0.9.1
- matplotlib = 3.5.2
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 PolygonSelector example linked in the Matplotlib documentation and reproduce it with ipympl in JupyterLab 3.4.2. Compare the working Qt backend with the notebook behavior, including the attempted useblit=False setting. Done means the gray cursor point and polygon drawing respond to mouse interaction in the notebook.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- jupyter, jupyter-notebook
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100