Skip to content
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

need for rubberband in zoom tool #3475

Closed
fariza opened this issue Sep 5, 2014 · 6 comments
Closed

need for rubberband in zoom tool #3475

fariza opened this issue Sep 5, 2014 · 6 comments
Milestone

Comments

@fariza
Copy link
Member

fariza commented Sep 5, 2014

Working on MEP22, I have been trying to find the right place to put the draw_rubberband method. That is specific to each backend.

One question arises:
What is the need for this method if we have matplotlib.widgets.RectangleSelector?

For what I can see, draw_rubberband dates prior to 2004, and RectangleSelector dates to 2005.
Maybe, and this is just a wild guess, mpl keept the rubberband just because it was there before.

Is there any technical reason for the existence of both? what would be the problem of just getting rid of rubberband and using RectangleSelector

@mdboom
Copy link
Member

mdboom commented Sep 5, 2014

draw_rubberband draws the box using the native calls in whatever GUI framework is being used. This can be a lot faster over a remote X11 connection, for example -- this is also important for the NbAgg backend where there might be a high-latency connection between the browser and the server. The RectangleSelector, as all matplotlib "widgets", uses Agg to do the drawing, so requires an expensive/high bandwidth transfer of the screen buffer.

@fariza
Copy link
Member Author

fariza commented Sep 5, 2014

Ok, that makes sense.
What would be the problem in using draw_rubberband inside the RectangleSelector (if available)?
I am just trying to unify things.

@mdboom
Copy link
Member

mdboom commented Sep 5, 2014

That may work -- definitely worth experimentation.

@tacaswell tacaswell added this to the v1.4.x milestone Sep 6, 2014
@tacaswell
Copy link
Member

@fariza Closing this as the question got answered. I assume this will be replaced by a PR anyway if it works.

Please ping to have re-opened if you disagree.

@blink1073
Copy link
Member

This could be used to replace the line version of the RectangleSelector, but it would be nice to keep the option to draw a patch with tunable options. I will add this to my PR.

@blink1073
Copy link
Member

Actually, what I ended up doing is using drawRectangle while dragging, and then drawing the desired shape upon release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants