From 9932bc9c40dec6735fa6fa295321b3ffbff730f6 Mon Sep 17 00:00:00 2001 From: Ian Hunt-Isaak Date: Wed, 28 Sep 2022 16:37:34 -0400 Subject: [PATCH 1/2] make spanselector codeblock continuous --- examples/widgets/span_selector.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/examples/widgets/span_selector.py b/examples/widgets/span_selector.py index 940948719d82..479361d4b063 100644 --- a/examples/widgets/span_selector.py +++ b/examples/widgets/span_selector.py @@ -10,6 +10,13 @@ selected range is then plotted on the lower axis. """ +############################################################################# +# .. note:: +# +# If the SpanSelector object is garbage collected you will lose the +# interactivity. You must keep a hard reference to it to prevent this. +# + import numpy as np import matplotlib.pyplot as plt from matplotlib.widgets import SpanSelector @@ -44,14 +51,6 @@ def onselect(xmin, xmax): fig.canvas.draw_idle() -############################################################################# -# .. note:: -# -# If the SpanSelector object is garbage collected you will lose the -# interactivity. You must keep a hard reference to it to prevent this. -# - - span = SpanSelector( ax1, onselect, From 9347935bf59154564ceba74eb02334346a52ee18 Mon Sep 17 00:00:00 2001 From: Ian Hunt-Isaak Date: Thu, 29 Sep 2022 09:41:29 -0400 Subject: [PATCH 2/2] move note into docstring --- examples/widgets/span_selector.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/examples/widgets/span_selector.py b/examples/widgets/span_selector.py index 479361d4b063..fa75a70d2863 100644 --- a/examples/widgets/span_selector.py +++ b/examples/widgets/span_selector.py @@ -8,14 +8,12 @@ Here, an x-range can be selected on the upper axis; a detailed view of the selected range is then plotted on the lower axis. -""" -############################################################################# -# .. note:: -# -# If the SpanSelector object is garbage collected you will lose the -# interactivity. You must keep a hard reference to it to prevent this. -# +.. note:: + + If the SpanSelector object is garbage collected you will lose the + interactivity. You must keep a hard reference to it to prevent this. +""" import numpy as np import matplotlib.pyplot as plt