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 e4154c4 + 609a840 commit 0554030Copy full SHA for 0554030
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