2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-11 12:46:37 +08:00

plot_xy: fix errorbar plot

This commit is contained in:
Robert Jördens 2016-04-08 01:21:59 +08:00
parent ca24e00400
commit 787ed65d00

View File

@ -42,7 +42,8 @@ class XYPlot(pyqtgraph.PlotWidget):
# See https://github.com/pyqtgraph/pyqtgraph/issues/211 # See https://github.com/pyqtgraph/pyqtgraph/issues/211
if hasattr(error, "__len__") and not isinstance(error, np.ndarray): if hasattr(error, "__len__") and not isinstance(error, np.ndarray):
error = np.array(error) 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) self.addItem(errbars)
if fit is not None: if fit is not None:
xi = np.argsort(x) xi = np.argsort(x)