diff --git a/PlotItem.py b/PlotItem.py index 0cbc9459..eb786f29 100644 --- a/PlotItem.py +++ b/PlotItem.py @@ -998,7 +998,7 @@ class PlotItem(QtGui.QGraphicsWidget): if arr.ndim != 1: raise Exception("Array must be 1D to plot (shape is %s)" % arr.shape) if x is None: - x = arange(arr.shape[0]) + x = np.arange(arr.shape[0]) if x.ndim != 1: raise Exception("X array must be 1D to plot (shape is %s)" % x.shape) c = PlotCurveItem(arr, x=x) diff --git a/examples/test_PlotWidget.py b/examples/test_PlotWidget.py index 80e4a9c4..a5f4960e 100755 --- a/examples/test_PlotWidget.py +++ b/examples/test_PlotWidget.py @@ -5,6 +5,7 @@ import sys, os sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..')) from scipy import random +from numpy import array, arange from PyQt4 import QtGui, QtCore from pyqtgraph.PlotWidget import * from pyqtgraph.graphicsItems import * @@ -90,4 +91,4 @@ for i in range(0, 5): yd, xd = rand(10000) pw2.plot(yd*(j+1), xd, params={'iter': i, 'val': j}) -#app.exec_() +app.exec_() diff --git a/graphicsItems.py b/graphicsItems.py index 299b9cf8..de935afa 100644 --- a/graphicsItems.py +++ b/graphicsItems.py @@ -573,7 +573,7 @@ class PlotCurveItem(GraphicsObject): self.xData = x if x is None: - self.xData = arange(0, self.yData.shape[0]) + self.xData = np.arange(0, self.yData.shape[0]) if self.xData.shape != self.yData.shape: raise Exception("X and Y arrays must be the same shape--got %s and %s." % (str(x.shape), str(y.shape)))