You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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.
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.
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.
Activity
mdboom commentedon Sep 5, 2014
draw_rubberbanddraws 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. TheRectangleSelector, as all matplotlib "widgets", uses Agg to do the drawing, so requires an expensive/high bandwidth transfer of the screen buffer.fariza commentedon Sep 5, 2014
Ok, that makes sense.
What would be the problem in using
draw_rubberbandinside theRectangleSelector(if available)?I am just trying to unify things.
mdboom commentedon Sep 5, 2014
That may work -- definitely worth experimentation.
tacaswell commentedon Sep 6, 2014
@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 commentedon Sep 11, 2014
This could be used to replace the
lineversion of theRectangleSelector, but it would be nice to keep the option to draw a patch with tunable options. I will add this to my PR.blink1073 commentedon Sep 11, 2014
Actually, what I ended up doing is using
drawRectanglewhile dragging, and then drawing the desired shape upon release.