Index: src/sas/qtgui/DataExplorer.py
===================================================================
--- src/sas/qtgui/DataExplorer.py	(revision 0cd861274c705e809cccd5c60271a4621dee35d3)
+++ src/sas/qtgui/DataExplorer.py	(revision 8cb6cd6e52ab1f1031a89aeaad89921ef6ed9e98)
@@ -13,6 +13,4 @@
 
 # SAS
-import GuiUtils
-from Plotter import Plotter
 from sas.sascalc.dataloader.loader import Loader
 from sas.sasgui.guiframe.data_manager import DataManager
@@ -20,4 +18,7 @@
 from sas.sasgui.guiframe.dataFitting import Data2D
 
+import GuiUtils
+import PlotHelper
+from Plotter import Plotter
 from DroppableDataLoadWidget import DroppableDataLoadWidget
 
@@ -46,4 +47,7 @@
         # Be careful with twisted threads.
         self.mutex = QMutex()
+
+        # Active plots
+        self.active_plots = []
 
         # Connect the buttons
@@ -54,4 +58,5 @@
         self.cmdSendTo.clicked.connect(self.sendData)
         self.cmdNew.clicked.connect(self.newPlot)
+        self.cmdAppend.clicked.connect(self.appendPlot)
         self.cmdHelp.clicked.connect(self.displayHelp)
         self.cmdHelp_2.clicked.connect(self.displayHelp)
@@ -76,4 +81,7 @@
         self.communicator = self.parent.communicator()
         self.communicator.fileReadSignal.connect(self.loadFromURL)
+        self.communicator.activeGraphsSignal.connect(self.updateGraphCombo)
+        self.cbgraph.editTextChanged.connect(self.enableGraphCombo)
+        self.cbgraph.currentIndexChanged.connect(self.enableGraphCombo)
 
         # Proxy model for showing a subset of Data1D/Data2D content
@@ -97,4 +105,6 @@
         self.freezeView.setModel(self.theory_proxy)
 
+        self.enableGraphCombo(None)
+
     def closeEvent(self, event):
         """
@@ -110,4 +120,11 @@
         self._helpView.load(QtCore.QUrl(_TreeLocation))
         self._helpView.show()
+
+    def enableGraphCombo(self, combo_text):
+        """
+        Enables/disables "Assign Plot" elements
+        """
+        self.cbgraph.setEnabled(len(PlotHelper.currentPlots()) > 0)
+        self.cmdAppend.setEnabled(len(PlotHelper.currentPlots()) > 0)
 
     def loadFromURL(self, url):
@@ -187,6 +204,9 @@
         delete_msg = "This operation will delete the checked data sets and all the dependents." +\
                      "\nDo you want to continue?"
-        reply = QtGui.QMessageBox.question(self, 'Warning', delete_msg,
-                QtGui.QMessageBox.Yes, QtGui.QMessageBox.No)
+        reply = QtGui.QMessageBox.question(self,
+                                           'Warning',
+                                           delete_msg,
+                                           QtGui.QMessageBox.Yes,
+                                           QtGui.QMessageBox.No)
 
         if reply == QtGui.QMessageBox.No:
@@ -263,11 +283,14 @@
             if not outer_item:
                 continue
-            for inner_index in xrange(outer_item.rowCount()): # Should be just two rows: data and Info
+            # Should be just two rows: data and Info
+            for inner_index in xrange(outer_item.rowCount()):
                 subitem = outer_item.child(inner_index)
-                if subitem and subitem.isCheckable() and subitem.checkState() == QtCore.Qt.Checked:
+                if subitem and \
+                   subitem.isCheckable() and \
+                   subitem.checkState() == QtCore.Qt.Checked:
                     theories_copied += 1
                     new_item = self.recursivelyCloneItem(subitem)
                     # Append a "unique" descriptor to the name
-                    time_bit = str(time.time())[7:-1].replace('.','')
+                    time_bit = str(time.time())[7:-1].replace('.', '')
                     new_name = new_item.text() + '_@' + time_bit
                     new_item.setText(new_name)
@@ -300,4 +323,19 @@
         return new_item
 
+    def updateGraphCombo(self, graph_list):
+        """
+        Modify Graph combo box on graph add/delete
+        """
+        orig_text = self.cbgraph.currentText()
+        self.cbgraph.clear()
+        graph_titles = []
+        for graph in graph_list:
+            graph_titles.append("Graph"+str(graph))
+        self.cbgraph.insertItems(0, graph_titles)
+        ind = self.cbgraph.findText(orig_text)
+        if ind > 0:
+            self.cbgraph.setCurrentIndex(ind)
+        pass
+
     def newPlot(self):
         """
@@ -306,14 +344,46 @@
         TODO: Add 2D-functionality
         """
-
         plots = GuiUtils.plotsFromCheckedItems(self.model)
 
         # Call show on requested plots
-        new_plot = Plotter()
+        new_plot = Plotter(self)
         for plot_set in plots:
             new_plot.data(plot_set)
             new_plot.plot()
 
+        # Update the global plot counter
+        title = "Graph"+str(PlotHelper.idOfPlot(new_plot))
+        new_plot.setWindowTitle(title)
+
+        # Add the plot to the workspace
+        self.parent.workspace().addWindow(new_plot)
+
+        # Show the plot
         new_plot.show()
+
+        # Update the active chart list
+        self.active_plots.append(title)
+
+    def appendPlot(self):
+        """
+        Add data set(s) to the existing matplotlib chart
+
+        TODO: Add 2D-functionality
+        """
+        # new plot data
+        new_plots = GuiUtils.plotsFromCheckedItems(self.model)
+
+        # old plot data
+        plot_id = self.cbgraph.currentText()
+        plot_id = int(plot_id[5:])
+
+        assert plot_id in PlotHelper.currentPlots(), "No such plot: Graph%s"%str(plot_id)
+
+        old_plot = PlotHelper.plotById(plot_id)
+
+        # Add new data to the old plot
+        for plot_set in new_plots:
+            old_plot.data(plot_set)
+            old_plot.plot()
 
     def chooseFiles(self):
@@ -424,5 +494,4 @@
                 else:
                     error_message += "%s\n" % str(p_file)
-                info = "error"
 
             current_percentage = int(100.0* index/number_of_files)
@@ -563,5 +632,5 @@
         Post message to status bar and update the data manager
         """
-        assert type(output) == tuple
+        assert isinstance(output, tuple)
 
         # Reset the model so the view gets updated.
