matplotlib / matplotlib/matplotlib

[ENH]: should Axes hold references to widgets?

Open
#24,373 7 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

New feature topic: widgets/UI
Dominant language
Python
Stars
23.2k
Forks
8.5k
Avg merge
1d 6h
Merged PRs (30d)
66

Description

### Problem

People often forget to hold a reference to a widget so that it‘s getting garbage collected, c.f. #24372.

### Proposed solution

Track widgets in a (maybe private) Axes attribute, as we do for artists.

The widget‘s artists (=visual part of the widget) are referenced, so there is a tight relationship. We should add the widget objects themselves (=logic part of the widget) as well.

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

Start by reading how Axes retains artist references and how widgets are associated with their artists. Trace the widget-related entry points and confirm that the resulting Axes state keeps widget objects alive, then add or update focused tests for garbage-collection behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-visualization
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.