Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Proposal: Interactive Selection Tools #5782

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
blink1073 opened this issue Jan 2, 2016 · 8 comments
Closed

Proposal: Interactive Selection Tools #5782

blink1073 opened this issue Jan 2, 2016 · 8 comments
Labels
New feature status: closed as inactive Issues closed by the "Stale" Github Action. Please comment on any you think should still be open. status: inactive Marked by the “Stale” Github Action

Comments

@blink1073
Copy link
Member

I propose a new module called interactive_selectors.py that provides a simplified interface for selection tools that can have interaction after they are drawn.

  • Create new Lasso, Rectangle, Polygon, Ellipse, Span, and Line tools.
  • Deprecate the _SelectorWidgets in favor of these new tools, which would have a much simpler interface and consistent behavior.
  • Support the ability to have multiple tools on the same axis, a use case we support in scikit-image, and is also provided in PyQtGraph.
  • Always blit if available while drawing, and then draw statically when finished if interactive=True (the default).
  • All tools will have a "move" handle in the center and other appropriate handles.

I would prefer to close #5751 and start work on this new module.

@blink1073
Copy link
Member Author

Note that the Paint tool I previously proposed would still live in widgets.py.

@blink1073
Copy link
Member Author

Code that provides the proper blit behavior:

def start(self):
    if self.interactive:
        for artist in self.artists:
            artist.set_visible(False)
        self.canvas.draw()
    for artist in self.artists:
        artist.set_animated(self.useblit)
        artist.set_visible(True)
    self.update()

def finish(self):
    if self.interactive:
        for artist in self.artists:
            artist.set_animated(False)
    else:
        for artist in self.artists:
            artist.set_visible(False)
    self.canvas.draw_idle()

@tacaswell
Copy link
Member

👍 from me. I have had similar thoughts (but not done anything about it).

@tacaswell tacaswell added this to the proposed next point release (2.1) milestone Jan 2, 2016
@blink1073
Copy link
Member Author

Great, good thing I already started working on it 😉

@pelson
Copy link
Member

pelson commented Jan 3, 2016

Just wondering, have you considered the ability to rotate the selector?

@blink1073
Copy link
Member Author

You could add a separate rotation handle and give it a different marker type, but I'm going to hold off on that for now.

@pelson
Copy link
Member

pelson commented Jan 4, 2016

but I'm going to hold off on that for now.

Not unreasonable at all. I was just mentioning as I can imagine it is a route we may take in the future, and it would be nice not to close the door on the possibility of doing so.

@tacaswell tacaswell modified the milestones: 2.1 (next point release), 2.2 (next next feature release) Oct 3, 2017
@github-actions
Copy link

This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!

@github-actions github-actions bot added the status: inactive Marked by the “Stale” Github Action label Mar 20, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 20, 2023
@rcomer rcomer added the status: closed as inactive Issues closed by the "Stale" Github Action. Please comment on any you think should still be open. label May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New feature status: closed as inactive Issues closed by the "Stale" Github Action. Please comment on any you think should still be open. status: inactive Marked by the “Stale” Github Action
Projects
None yet
Development

No branches or pull requests

5 participants