matplotlib icon indicating copy to clipboard operation
matplotlib copied to clipboard

[ENH]: Add multiple span selector

Open mattgebert opened this issue 1 year ago • 0 comments

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

mattgebert avatar Jun 28 '24 04:06 mattgebert