diff --git a/pyqtgraph/functions.py b/pyqtgraph/functions.py index 64dad102..db22f8a3 100644 --- a/pyqtgraph/functions.py +++ b/pyqtgraph/functions.py @@ -1157,6 +1157,8 @@ def arrayToQPath(x, y, connect='all'): # decide which points are connected by lines if connect == 'pairs': connect = np.empty((n/2,2), dtype=np.int32) + if connect.size != n: + raise Exception("x,y array lengths must be multiple of 2 to use connect='pairs'") connect[:,0] = 1 connect[:,1] = 0 connect = connect.flatten()