diff --git a/src/sas/qtgui/Plotting/Plotter.py b/src/sas/qtgui/Plotting/Plotter.py index 998baac4ee..4137c95ae5 100644 --- a/src/sas/qtgui/Plotting/Plotter.py +++ b/src/sas/qtgui/Plotting/Plotter.py @@ -78,21 +78,12 @@ def data(self): @data.setter def data(self, value): """ data setter """ - #self._data = value - self._data.append(value) - if value._xunit: - self.xLabel = "%s(%s)"%(value._xaxis, value._xunit) + data_names = [item.name for item in self._data] + if value.name in data_names: + data_index = data_names.index(value.name) + self._data[data_index] = value else: - self.xLabel = "%s"%(value._xaxis) - if value._yunit: - self.yLabel = "%s(%s)"%(value._yaxis, value._yunit) - else: - self.yLabel = "%s"%(value._yaxis) - - if value.scale == 'linear' or value.isSesans: - self.xscale = 'linear' - self.yscale = 'linear' - self.title(title=value.name) + self._data.append(value) def plot(self, data=None, color=None, marker=None, hide_error=False, transform=True): """ @@ -105,7 +96,7 @@ def plot(self, data=None, color=None, marker=None, hide_error=False, transform=T # Data1D if isinstance(data, Data1D): - self.data.append(data) + self.data = data is_fit = (data.id=="fit") diff --git a/src/sas/qtgui/Plotting/UnitTesting/PlotterTest.py b/src/sas/qtgui/Plotting/UnitTesting/PlotterTest.py index d70bc7d134..baa67805c4 100644 --- a/src/sas/qtgui/Plotting/UnitTesting/PlotterTest.py +++ b/src/sas/qtgui/Plotting/UnitTesting/PlotterTest.py @@ -44,15 +44,6 @@ def workspace(self): yield p - def testDataProperty(self, plotter): - """ Adding data """ - plotter.data = self.data - - assert plotter.data[0] == self.data - assert plotter._title == self.data.name - assert plotter.xLabel == "" - assert plotter.yLabel == "" - def testPlotWithErrors(self, plotter, mocker): """ Look at the plotting with error bars""" plotter.data = self.data