From 6f73f0673c5a99e3ceea7d6633eabd09b5243eae Mon Sep 17 00:00:00 2001 From: Derek Tropf Date: Mon, 14 Aug 2017 10:14:32 -0400 Subject: [PATCH 1/4] Added RectangleSelector.geometry docstring Docstring contains details specific to RectangleSelector and does not fully generalize to EllipseSelector. --- lib/matplotlib/widgets.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/matplotlib/widgets.py b/lib/matplotlib/widgets.py index 2c395250b2e5..9d4a9bd20c71 100644 --- a/lib/matplotlib/widgets.py +++ b/lib/matplotlib/widgets.py @@ -2334,6 +2334,11 @@ def _set_active_handle(self, event): @property def geometry(self): + """ + Returns numpy.ndarray of shape (2,5) containing x (RectangleSelector.geometry[1:]) + and y (RectangleSelector.geometry[0:]) coordinates of the four corners of the rectangle starting + and ending in the top left corner. + """ if hasattr(self.to_draw, 'get_verts'): xfm = self.ax.transData.inverted() y, x = xfm.transform(self.to_draw.get_verts()).T From 3dd0bf6ca2390a1698c6c40dcb376a794fdfbd71 Mon Sep 17 00:00:00 2001 From: Derek Tropf Date: Fri, 18 Aug 2017 09:34:12 -0400 Subject: [PATCH 2/4] Fixed PEP8 issue with RectangleSelector.geoemtry docstring Wrapped docstring to <80 characters --- lib/matplotlib/widgets.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/widgets.py b/lib/matplotlib/widgets.py index 9d4a9bd20c71..3cfcac99a69c 100644 --- a/lib/matplotlib/widgets.py +++ b/lib/matplotlib/widgets.py @@ -2335,8 +2335,9 @@ def _set_active_handle(self, event): @property def geometry(self): """ - Returns numpy.ndarray of shape (2,5) containing x (RectangleSelector.geometry[1:]) - and y (RectangleSelector.geometry[0:]) coordinates of the four corners of the rectangle starting + Returns numpy.ndarray of shape (2,5) containing x + (RectangleSelector.geometry[1,:]) and y (RectangleSelector.geometry[0,:]) + coordinates of the four corners of the rectangle starting and ending in the top left corner. """ if hasattr(self.to_draw, 'get_verts'): From 542032d1fd48abc637465de2e22192bdc33e2cc5 Mon Sep 17 00:00:00 2001 From: Derek Tropf Date: Fri, 18 Aug 2017 09:46:10 -0400 Subject: [PATCH 3/4] Corrected indentation of docstring --- lib/matplotlib/widgets.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/matplotlib/widgets.py b/lib/matplotlib/widgets.py index 3cfcac99a69c..8eadc7738bef 100644 --- a/lib/matplotlib/widgets.py +++ b/lib/matplotlib/widgets.py @@ -2334,12 +2334,13 @@ def _set_active_handle(self, event): @property def geometry(self): - """ - Returns numpy.ndarray of shape (2,5) containing x - (RectangleSelector.geometry[1,:]) and y (RectangleSelector.geometry[0,:]) - coordinates of the four corners of the rectangle starting - and ending in the top left corner. - """ + """ + Returns numpy.ndarray of shape (2,5) containing + x (RectangleSelector.geometry[1,:]) and + y (RectangleSelector.geometry[0,:]) + coordinates of the four corners of the rectangle starting + and ending in the top left corner. + """ if hasattr(self.to_draw, 'get_verts'): xfm = self.ax.transData.inverted() y, x = xfm.transform(self.to_draw.get_verts()).T From 82f1465ea69bfead1793b6018b6c32b63b554234 Mon Sep 17 00:00:00 2001 From: David Stansby Date: Tue, 29 Aug 2017 20:28:22 +0100 Subject: [PATCH 4/4] Fix PEP8 issues --- lib/matplotlib/widgets.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/matplotlib/widgets.py b/lib/matplotlib/widgets.py index 8eadc7738bef..8b4055643a74 100644 --- a/lib/matplotlib/widgets.py +++ b/lib/matplotlib/widgets.py @@ -2335,12 +2335,12 @@ def _set_active_handle(self, event): @property def geometry(self): """ - Returns numpy.ndarray of shape (2,5) containing - x (RectangleSelector.geometry[1,:]) and - y (RectangleSelector.geometry[0,:]) + Returns numpy.ndarray of shape (2,5) containing + x (``RectangleSelector.geometry[1,:]``) and + y (``RectangleSelector.geometry[0,:]``) coordinates of the four corners of the rectangle starting and ending in the top left corner. - """ + """ if hasattr(self.to_draw, 'get_verts'): xfm = self.ax.transData.inverted() y, x = xfm.transform(self.to_draw.get_verts()).T