From c17f69a51b78dea681bfeeca3b47d06d3357b79b Mon Sep 17 00:00:00 2001 From: Simon Renblad Date: Wed, 12 Jul 2023 12:04:50 +0800 Subject: [PATCH] plot_xy: refactor data_changed --- artiq/applets/plot_xy.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/artiq/applets/plot_xy.py b/artiq/applets/plot_xy.py index bb3eab388..3838ce345 100755 --- a/artiq/applets/plot_xy.py +++ b/artiq/applets/plot_xy.py @@ -19,16 +19,16 @@ class XYPlot(pyqtgraph.PlotWidget): 'Error bars': False, 'Fit values': False} - def data_changed(self, data, mods, title): + def data_changed(self, value, metadata, persist, mods, title): try: - y = data[self.args.y][1] + y = value[self.args.y] except KeyError: return - x = data.get(self.args.x, (False, None))[1] + x = value.get(self.args.x, (False, None)) if x is None: x = np.arange(len(y)) - error = data.get(self.args.error, (False, None))[1] - fit = data.get(self.args.fit, (False, None))[1] + error = value.get(self.args.error, (False, None)) + fit = value.get(self.args.fit, (False, None)) if not len(y) or len(y) != len(x): self.mismatch['X values'] = True