matplotlib / matplotlib/matplotlib
[ENH]: Add multiple span selector
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 23.2k
- Forks
- 8.5k
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 66
Description
### Problem
`matplotlib.widgets.SpanSelector` is a useful widget, however only supports one span to be created because of how the class functionality tracks movement and positioning on a screen.
### Proposed solution
Would there be interest in an `NSpanSelector`, which would generalize SpanSelector to N many spans controlled by a single object?
I've written a demo for `NSpanSelector` which is subclass of `SpanSelector`, that corrects the handling functionality for multiple spans. I haven't contributed to many open source projects before. I'm not sure if something like this would even be wanted by others - I had a particular use case where two selectors were needed simultaneously. But since I've written it I'm happy to contribute it!
Here's a snapshot of my example implementation.

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 reviewing matplotlib.widgets.SpanSelector and the proposed NSpanSelector demo described in the issue. Before implementation, clarify whether a multi-span API is wanted, its interaction model, and the tests or examples that would define completion.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- matplotlib, python
- Domain
- data-visualization
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100