diff --git a/mainwin.py b/mainwin.py index 476c4a9..e4dceda 100644 --- a/mainwin.py +++ b/mainwin.py @@ -47,13 +47,13 @@ class MainWindow(QMainWindow): self.sig_make_new_plot.emit(name, pd) - def append_data(self, name, xy): + def append_data(self, name, point): lst = self.lst - lst.append(name, xy) + lst.append(name, point) for sub in self.mdi.subWindowList(): if sub.windowTitle() == name: pd = lst.data[name] - sub.plot.setData(pd.xs, pd.ys) + sub.plot.setData(*pd.data) def on_select_list_item(self, index): diff --git a/plotdesc.py b/plotdesc.py index be7f042..945681d 100644 --- a/plotdesc.py +++ b/plotdesc.py @@ -12,6 +12,11 @@ class PlotDescription: self.style = pg_plot_style() + @property + def data(self): + return (self.xs, self.ys) + + def append(self, xy): x, y = xy self.xs.append(x)