Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9149d8c

Browse files
dstansbyMeeseeksDev[bot]
authored and
MeeseeksDev[bot]
committed
Backport PR #9031: Added RectangleSelector.geometry docstring
Docstring contains details specific to RectangleSelector and does not fully generalize to EllipseSelector. <!--Thank you so much for your PR! To help us review, fill out the form to the best of your ability. Please make use of the development guide at https://matplotlib.org/devdocs/devel/index.html--> <!--Provide a general summary of your changes in the title above, for example "Raises ValueError on Non-Numeric Input to set_xlim". Please avoid non-descriptive titles such as "Addresses issue 8576".--> <!--If you are able to do so, please do not create the PR out of master, but out of a separate branch. See https://matplotlib.org/devel/gitwash/development_workflow.html for instructions.--> PR Summary <!--Please provide at least 1-2 sentences describing the pull request in detail. Why is this change required? What problem does it solve?--> Matplotlib documentation is missing details concerning the geometry attribute for RectangleSelector. This change provides a docstring for said attribute which is specific to RectangleSelector and not generalizable to EllipseSelector. <!--If it fixes an open issue, please link to the issue here.--> PR Checklist - [ x] Has Pytest style unit tests - [ x] Code is PEP 8 compliant - [ x] New features are documented, with examples if plot related - [ x] Documentation is sphinx and numpydoc compliant - [ x] Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there) - [x ] Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way <!--We understand that PRs can sometimes be overwhelming, especially as the reviews start coming in. Please let us know if the reviews are unclear or the recommended next step seems overly demanding , or if you would like help in addressing a reviewer's comments. And please ping us if you've been waiting too long to hear back on your PR.-->
1 parent 172daf8 commit 9149d8c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/matplotlib/widgets.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2334,6 +2334,13 @@ def _set_active_handle(self, event):
23342334

23352335
@property
23362336
def geometry(self):
2337+
"""
2338+
Returns numpy.ndarray of shape (2,5) containing
2339+
x (``RectangleSelector.geometry[1,:]``) and
2340+
y (``RectangleSelector.geometry[0,:]``)
2341+
coordinates of the four corners of the rectangle starting
2342+
and ending in the top left corner.
2343+
"""
23372344
if hasattr(self.to_draw, 'get_verts'):
23382345
xfm = self.ax.transData.inverted()
23392346
y, x = xfm.transform(self.to_draw.get_verts()).T

0 commit comments

Comments
 (0)