plot_xy: fix errorbar plot

pull/605/head
Robert Jördens 2016-04-08 01:21:59 +08:00
parent 3e6a8a20c3
commit 37bcd5ab7e
1 changed files with 2 additions and 1 deletions

View File

@ -43,7 +43,8 @@ class XYPlot(pyqtgraph.PlotWidget):
# See https://github.com/pyqtgraph/pyqtgraph/issues/211
if hasattr(error, "__len__") and not isinstance(error, np.ndarray):
error = np.array(error)
errbars = pg.ErrorBarItem(x=np.array(x), y=np.array(y), height=error)
errbars = pyqtgraph.ErrorBarItem(
x=np.array(x), y=np.array(y), height=error)
self.addItem(errbars)
if fit is not None:
xi = np.argsort(x)