widgets: RectangleSelector return values

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

widgets: RectangleSelector return values

Dale Huffman
I was using the RectangleSelector widget from an older version of
matplotlib and it returned the eclick and erelease objects, matching the
example code in the docstring.  The eclick.xdata and eclick.ydata
matched the click event and the erelease.xdata and erelease.ydata
matched the release event.
In the new 1.5.3 version (probably recent older versions also - not sure
exactly when it changed) it is only returning the extents of the
rectangle, regardless of whether they occurred on the click or release
event.  For example if you select the rectangle from top/left to
bottom/right you get the same values as is you have selected from
bottom/left to top/right.
Unfortunately, I am using this information to do different things, base
on the direction of the rectangle selection.  Is this new method
intentional, or is it a bug?  I've made a crappy patch for the code to
work for me, but obviously don't want to do this at each update to
matplotlib.  Either way it seems to me that either the docstring needs
to be updated to show the new extents based version or the code changed
to return the actual data from the two events, instead of just the
extents of the rectangle.
Please educate me if I'm completely off base here.



_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: widgets: RectangleSelector return values

tcaswell
That seems like an intentional change to me, but one we might want to reconsider.

I think this change went in via https://github.com/matplotlib/matplotlib/pull/3937  

At a minimum, the selector should probably grow an option to preserve the order.

Tom

On Tue, Nov 15, 2016 at 12:56 PM Dale Huffman <[hidden email]> wrote:
I was using the RectangleSelector widget from an older version of
matplotlib and it returned the eclick and erelease objects, matching the
example code in the docstring.  The eclick.xdata and eclick.ydata
matched the click event and the erelease.xdata and erelease.ydata
matched the release event.
In the new 1.5.3 version (probably recent older versions also - not sure
exactly when it changed) it is only returning the extents of the
rectangle, regardless of whether they occurred on the click or release
event.  For example if you select the rectangle from top/left to
bottom/right you get the same values as is you have selected from
bottom/left to top/right.
Unfortunately, I am using this information to do different things, base
on the direction of the rectangle selection.  Is this new method
intentional, or is it a bug?  I've made a crappy patch for the code to
work for me, but obviously don't want to do this at each update to
matplotlib.  Either way it seems to me that either the docstring needs
to be updated to show the new extents based version or the code changed
to return the actual data from the two events, instead of just the
extents of the rectangle.
Please educate me if I'm completely off base here.



_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users

_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Loading...