Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents de18beb + 3693d1d commit 86acc0cCopy full SHA for 86acc0c
1 file changed
examples/widgets/span_selector.py
@@ -32,10 +32,12 @@ def onselect(xmin, xmax):
32
33
region_x = x[indmin:indmax]
34
region_y = y[indmin:indmax]
35
- line2.set_data(region_x, region_y)
36
- ax2.set_xlim(region_x[0], region_x[-1])
37
- ax2.set_ylim(region_y.min(), region_y.max())
38
- fig.canvas.draw()
+
+ if len(region_x) >= 2:
+ line2.set_data(region_x, region_y)
+ ax2.set_xlim(region_x[0], region_x[-1])
39
+ ax2.set_ylim(region_y.min(), region_y.max())
40
+ fig.canvas.draw()
41
42
#############################################################################
43
# .. note::
0 commit comments