matplotlib / matplotlib/ipympl

MPL Event Handling Doc Example not fully functioning

Open
#315 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Jupyter Notebook
Stars
1.7k
Forks
234
PR merge metrics
No merged PRs in 30d

Description

I tried the example from the MPL event handling docs: a bar chart with draggable bars ("extra credit" version). This works fine in QT5Agg backend, but doesn't fully work in Jupyter Lab (v3.0.7) with ipympl (v0.7.0). The plot displays fine, and I can see that click and drag events are being received by the widget, but during drag, the bars vanish. In fact, if in the click handler I include a color change:

        self.rect.set(animated=True,color='red')

Then I can see a faint red outline after the bar is "dropped" in the correct location (see below). So clearly the click/drag/release events are working, but the bar drawing during and after drag via draw_artist and blit are not.

image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the draggable rectangle exercise from the MPL event handling documentation with JupyterLab 3.0.7 and ipympl 0.7.0, then compare it with QT5Agg. Trace the draw_artist and blit calls during dragging; done means the bars remain visible and draggable in the Jupyter environment.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter, python
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.