[Matplotlib-users] widgets: RectangleSelector return values

Dale Huffman deh at case.edu
Tue Nov 15 12:54:36 EST 2016


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.





More information about the Matplotlib-users mailing list