widgets: RectangleSelector return values

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.

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

I think this change went in via

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 <deh at case.edu> 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
Matplotlib-users at python.org
Matplotlib-users Info Page

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20161115/bfe4bd47/attachment.html&gt;