Index: plottools/src/danse/common/plottools/PlotPanel.py
===================================================================
--- plottools/src/danse/common/plottools/PlotPanel.py	(revision ebbc421c8ff6c6cc41ba7b2d73916799e228be44)
+++ plottools/src/danse/common/plottools/PlotPanel.py	(revision 6e75ed00993b61a2a3512eed9133a3721ced22b5)
@@ -595,5 +595,5 @@
                 ax.set_ylim((lo,hi))
         else:
-             # Check if zoom happens in the axes
+            # Check if zoom happens in the axes
             xdata, ydata = None, None
             x, y = event.x, event.y
Index: sansguiframe/src/sans/guiframe/gui_manager.py
===================================================================
--- sansguiframe/src/sans/guiframe/gui_manager.py	(revision 5cc6d20e7b9ff372665e346baca53492c11143b8)
+++ sansguiframe/src/sans/guiframe/gui_manager.py	(revision 6e75ed00993b61a2a3512eed9133a3721ced22b5)
@@ -427,5 +427,4 @@
             if count >= 2:
                 column_names_line = line
-                first_data_index = index
                 break 
            
@@ -460,6 +459,6 @@
         fd.write(str(details))
         for col_name  in data.keys():
-             fd.write(str(col_name))
-             fd.write(separator)
+            fd.write(str(col_name))
+            fd.write(separator)
         fd.write('\n')
         max_list = [len(value) for value in data.values()]
@@ -904,5 +903,5 @@
         # Show a default panel with some help information
         # It also sets the size of the application windows
-        #TODO: Use this for slpash screen
+        #TODO: Use this for splash screen
         if self.defaultPanel is None:
             self.defaultPanel = DefaultPanel(self, -1, style=wx.RAISED_BORDER)
@@ -1028,4 +1027,18 @@
         return menu_list
         
+        
+    def on_panel_close(self, event):
+        """
+        Gets called when the close event for a panel runs.
+        This will check which panel has been closed and
+        delete it.
+        """
+        panel = event.GetPane()
+        for ID in self.plot_panels.keys():
+            if self.plot_panels[ID].window_name == panel.name:
+                self.delete_panel(ID)
+                break
+    
+    
     def popup_panel(self, p):
         """
@@ -1045,14 +1058,5 @@
             windowcaption = 'Graph'#p.window_caption
         windowname = p.window_name
-        """
-        count = 0
-        for item in self.panels:
-            if self.panels[item].window_name.startswith(p.window_name)\
-               or self._mgr.GetPane(p.window_name).IsOk(): 
-                count += 1
-        
-        if count > 0:
-            windowname += str(count+1)
-        """
+
         # Append nummber
         captions = self._get_plotpanel_captions()
@@ -1067,5 +1071,4 @@
         if p.window_caption.split()[0] not in NOT_SO_GRAPH_LIST:
             p.window_caption = caption 
-        #p.window_caption = windowcaption+ str(self.graph_num)
         p.window_name = windowname + str(self.graph_num)
         
@@ -1100,5 +1103,7 @@
             
             self._popup_floating_panel(p)
-  
+        
+        # Register for closing of panels
+        self.Bind(wx.aui.EVT_AUI_PANE_CLOSE, self.on_panel_close)
         # Register for showing/hiding the panel
         wx.EVT_MENU(self, ID, self.on_view)
@@ -1475,5 +1480,5 @@
         """
         
-         # File menu
+        # File menu
         self._file_menu = wx.Menu()
         #append item from plugin under menu file if necessary
@@ -1742,4 +1747,6 @@
             if self._mgr.GetPane(self.panels[ID].window_name).IsShown():
                 self._mgr.GetPane(self.panels[ID].window_name).Hide()
+                item = self._plotting_plugin.menu.FindItemById(uid)
+                item.Check(False)
                 if self._data_panel is not None and \
                             ID in self.plot_panels.keys():
@@ -1769,5 +1776,5 @@
             panel.Close()
             if panel in self.schedule_full_draw_list:
-               self.schedule_full_draw_list.remove(panel) 
+                self.schedule_full_draw_list.remove(panel) 
             
             #delete uid number not str(uid)
@@ -1839,5 +1846,5 @@
             path = os.path.abspath(path)
             if not os.path.isfile(path) and not os.path.isdir(path):
-               return
+                return
             
             if os.path.isdir(path):
@@ -2054,8 +2061,8 @@
                 logging.error(msg)
         except:
-           msg = "Error occurred while saving: "
-           msg += "To save, at leat one application panel "
-           msg += "should have a data set.."
-           wx.PostEvent(self, StatusEvent(status=msg))    
+            msg = "Error occurred while saving: "
+            msg += "To save, at leat one application panel "
+            msg += "should have a data set.."
+            wx.PostEvent(self, StatusEvent(status=msg))    
                     
     def on_save_helper(self, doc, reader, panel, path):
@@ -3497,4 +3504,2 @@
     app = ViewApp(0)
     app.MainLoop()
-
-             
Index: sansguiframe/src/sans/guiframe/gui_style.py
===================================================================
--- sansguiframe/src/sans/guiframe/gui_style.py	(revision 07dd0b4438633afdbc6df35422fa5656d80c46e3)
+++ sansguiframe/src/sans/guiframe/gui_style.py	(revision 6e75ed00993b61a2a3512eed9133a3721ced22b5)
@@ -54,4 +54,5 @@
     PREVIEW_ID_PATH = os.path.join(PATH, 'report.png')
     PRINT_ID_PATH = os.path.join(PATH, 'printer.png')
+    HIDE_ID_PATH = os.path.join(PATH, 'hide.png')
     
   
@@ -70,4 +71,5 @@
     PREVIEW_ICON = wx.Image(os.path.join(PATH, 'preview.png'))
     PRINT_ICON = wx.Image(os.path.join(PATH, 'printer.png'))
+    HIDE_ICON = wx.Image(os.path.join(PATH, 'hide.png'))
 
 if __name__ == "__main__":
@@ -83,5 +85,2 @@
     print style1 == GUIFRAME.DEFAULT_STYLE
     print style1
-    
- 
-  
Index: sansguiframe/src/sans/guiframe/local_perspectives/plotting/Plotter1D.py
===================================================================
--- sansguiframe/src/sans/guiframe/local_perspectives/plotting/Plotter1D.py	(revision 7fb69f2679188b23fde8b62b6de7f5128855296f)
+++ sansguiframe/src/sans/guiframe/local_perspectives/plotting/Plotter1D.py	(revision 6e75ed00993b61a2a3512eed9133a3721ced22b5)
@@ -34,4 +34,5 @@
 from sans.guiframe.dataFitting import Data1D
 from sans.guiframe.panel_base import PanelBase
+from sans.guiframe.gui_style import GUIFRAME_ICON
 from binder import BindArtist
 
@@ -93,5 +94,6 @@
         self.Bind(wx.EVT_SIZE, self._OnReSize)
         self._add_more_tool()
-        self.parent.SetFocus() 
+        self.parent.SetFocus()
+        
         
     def get_symbol_label(self):
@@ -682,5 +684,5 @@
     def _add_more_tool(self):
         """
-        Add refresh, add/delete button in the tool bar
+        Add refresh, add/hide button in the tool bar
         """
         if self.parent.__class__.__name__ != 'ViewerFrame':
@@ -688,10 +690,8 @@
         self.toolbar.AddSeparator()
         id_delete = wx.NewId()
-        delete =  wx.ArtProvider.GetBitmap(wx.ART_DELETE, wx.ART_TOOLBAR)
-        self.toolbar.AddSimpleTool(id_delete, delete,
-                           'Delete', 'permanently Delete')
-
+        delete = wx.Bitmap(GUIFRAME_ICON.HIDE_ID_PATH, wx.BITMAP_TYPE_PNG)
+        self.toolbar.AddSimpleTool(id_delete, delete, 'Hide', 'Hide')
         self.toolbar.Realize()
-        wx.EVT_TOOL(self, id_delete,  self._on_delete)
+        wx.EVT_TOOL(self, id_delete,  self._on_hide)
         
         """
@@ -705,13 +705,11 @@
         wx.EVT_TOOL(self, id_text,  self._on_removetext)
         """
-    def _on_delete(self, event): 
-        """
-        Refreshes the plotpanel on refresh tollbar button
-        """
-        
+        
+    def _on_hide(self, event):
+        """
+        Hides the plot when button is pressed
+        """     
         if self.parent is not None:
-            wx.PostEvent(self.parent, 
-                         NewPlotEvent(group_id=self.group_id,
-                                      action="delete"))
-            
-            
+            self.parent.hide_panel(self.uid)
+            
+            
Index: sansguiframe/src/sans/guiframe/local_perspectives/plotting/plotting.py
===================================================================
--- sansguiframe/src/sans/guiframe/local_perspectives/plotting/plotting.py	(revision cdf515f3c6a20f738376a99e1979082503a4a624)
+++ sansguiframe/src/sans/guiframe/local_perspectives/plotting/plotting.py	(revision 6e75ed00993b61a2a3512eed9133a3721ced22b5)
@@ -144,5 +144,5 @@
         """
         """
-         ## Set group ID if available
+        ## Set group ID if available
         ## Assign data properties to the new create panel
         new_panel.set_manager(self)
@@ -174,6 +174,4 @@
         self.menu.Check(event_id, IS_WIN)
         wx.EVT_MENU(self.parent, event_id, self._on_check_menu)
-
-        wx.EVT_SHOW(new_panel, self._on_close_panel)
 
         
@@ -309,5 +307,5 @@
                 new_panel = self.create_2d_panel(data, group_id)
             self.create_panel_helper(new_panel, data, group_id, title)
-      
+            
         return
 
@@ -340,27 +338,2 @@
                     pass  
         frame.Show(True)
-              
-    def _on_close_panel(self, event):
-        """
-        Update check mark on panel's show and hide event
-        """
-        event.Skip()
-        panel = event.GetEventObject()
-        id = panel.uid
-        if event.GetShow() and self.parent._mgr.GetPane(panel).IsShown():
-            try:
-                if self.menu.FindItemById(id) != None:
-                    if not self.menu.IsChecked(id):
-                        self.menu.Check(id, True)
-                        #self.menu.Enable(id, False)
-            except:
-                # when no such item; may happens after delete
-                pass
-        else:
-            try:
-                if self.menu.FindItemById(id) != None:
-                    if self.menu.IsChecked(id):
-                        self.menu.Check(id, False)
-                        #self.menu.Enable(id, True)
-            except:
-                pass 
