matplotlib / matplotlib/matplotlib
Make Widget.useblit robust against underlying canvas changes
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 23.2k
- Forks
- 8.5k
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 66
Description
As noted in https://github.com/matplotlib/matplotlib/pull/30490#discussion_r2312635485 (and #30485, the original issue, also #25075), Widget.canvas, which is typically initialized as `self.useblit = useblit and canvas.supports_blit`, is fragile against changes in the underlying canvas (the most common case in practice being a temporarily switch from a canvas that supports blitting to one that doesn't, when saving to vector output).
@tacaswell wrote some code to handle that in #25085, but some further fixes were necessary in #30490 which uses a different approach; a unified way of handling the issue would be nice to have.
**Status:**
- [x] Button
- [x] _SelectorWidget
- [x] SpanSelector
- [x] ToolLineHandles
- [x] ToolHandles
- [x] RectangleSelector
- [x] LassoSelector
- [x] PolygonSelector
Not supported yet:
- [ ] CheckButtons
- [ ] RadioButtons
- [ ] Cursor
- [ ] MultiCursor
- [ ] Lasso
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 discussion in PR #30490, along with issues #30485 and #25075, and review the checked and unchecked widget list in this issue. Trace how Widget.canvas and useblit behave when the canvas changes during vector output; done means the remaining CheckButtons, RadioButtons, Cursor, MultiCursor, and Lasso cases are handled consistently.
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
- 35/100