Skip to content

Commit 7a99cb2

Browse files
Merge pull request #59 from CEAVirginie/patch-1
QwtPointArrayData: automatically adjust array size if x and y have different sizes
2 parents b494c3d + 6eabf4d commit 7a99cb2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

qwt/plot_series.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,10 @@ def __init__(self, x=None, y=None, size=None, finite=None):
237237
if size is not None:
238238
x = np.resize(x, (size,))
239239
y = np.resize(y, (size,))
240+
if len(x) != len(y):
241+
minlen = min(len(x), len(y))
242+
x = np.resize(x, (minlen, ))
243+
y = np.resize(y, (minlen, ))
240244
if finite if finite is not None else True:
241245
indexes = np.logical_and(np.isfinite(x), np.isfinite(y))
242246
self.__x = x[indexes]

0 commit comments

Comments
 (0)