Skip to content

[ENH]: Add multiple span selector #28484

@mattgebert

Description

@mattgebert

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.
image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions