From 631240929f08fd39fdb5cb28926a9e4bc61981e3 Mon Sep 17 00:00:00 2001 From: Joshua Stevenson Date: Wed, 29 Nov 2023 15:27:28 -0500 Subject: [PATCH 1/4] SpanSelector widget: Improve doc for `extents` --- lib/matplotlib/widgets.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/widgets.py b/lib/matplotlib/widgets.py index cd9716408303..354e18728447 100644 --- a/lib/matplotlib/widgets.py +++ b/lib/matplotlib/widgets.py @@ -2695,7 +2695,7 @@ def _press(self, event): @property def direction(self): - """Direction of the span selector: 'vertical' or 'horizontal'.""" + """Direction of the span selector: 'vertical' or 'horizontal'. Writable.""" return self._direction @direction.setter @@ -2855,7 +2855,12 @@ def _snap(values, snap_values): @property def extents(self): - """Return extents of the span selector.""" + """ + (float, float) + The axis values for the start and end points of the current selection. + If there is no selection then the start and end values will be the same. + Writable. + """ if self.direction == 'horizontal': vmin = self._selection_artist.get_x() vmax = vmin + self._selection_artist.get_width() From a33125091cd08760e0f5a25801ca430a12b344a6 Mon Sep 17 00:00:00 2001 From: judfs <39133604+judfs@users.noreply.github.com> Date: Wed, 29 Nov 2023 18:37:47 -0500 Subject: [PATCH 2/4] Update lib/matplotlib/widgets.py Co-authored-by: hannah --- lib/matplotlib/widgets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/widgets.py b/lib/matplotlib/widgets.py index 354e18728447..717d1be83050 100644 --- a/lib/matplotlib/widgets.py +++ b/lib/matplotlib/widgets.py @@ -2857,7 +2857,7 @@ def _snap(values, snap_values): def extents(self): """ (float, float) - The axis values for the start and end points of the current selection. + The values, in data coordinates, for the start and end points of the current selection. If there is no selection then the start and end values will be the same. Writable. """ From c311ec5fd4a5397000d7fb3262fe29c9a2f63f97 Mon Sep 17 00:00:00 2001 From: Joshua Stevenson Date: Thu, 30 Nov 2023 10:00:32 -0500 Subject: [PATCH 3/4] Fix formatting --- lib/matplotlib/widgets.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/matplotlib/widgets.py b/lib/matplotlib/widgets.py index 717d1be83050..ba91d96a2e83 100644 --- a/lib/matplotlib/widgets.py +++ b/lib/matplotlib/widgets.py @@ -2857,9 +2857,9 @@ def _snap(values, snap_values): def extents(self): """ (float, float) - The values, in data coordinates, for the start and end points of the current selection. - If there is no selection then the start and end values will be the same. - Writable. + The values, in data coordinates, for the start and end points of the current + selection. If there is no selection then the start and end values will be + the same. Writable. """ if self.direction == 'horizontal': vmin = self._selection_artist.get_x() From 72a18ccab6af9a7e833ed5afe9cbc5b1bb8958fc Mon Sep 17 00:00:00 2001 From: Joshua Stevenson Date: Tue, 5 Dec 2023 14:38:51 -0500 Subject: [PATCH 4/4] remove "Writable." note --- lib/matplotlib/widgets.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/widgets.py b/lib/matplotlib/widgets.py index ba91d96a2e83..0c00667ac936 100644 --- a/lib/matplotlib/widgets.py +++ b/lib/matplotlib/widgets.py @@ -2695,7 +2695,7 @@ def _press(self, event): @property def direction(self): - """Direction of the span selector: 'vertical' or 'horizontal'. Writable.""" + """Direction of the span selector: 'vertical' or 'horizontal'.""" return self._direction @direction.setter @@ -2859,7 +2859,7 @@ def extents(self): (float, float) The values, in data coordinates, for the start and end points of the current selection. If there is no selection then the start and end values will be - the same. Writable. + the same. """ if self.direction == 'horizontal': vmin = self._selection_artist.get_x()