Index: guiframe/local_perspectives/plotting/Plotter1D.py
===================================================================
--- guiframe/local_perspectives/plotting/Plotter1D.py	(revision 6285a792a5f377a2de854d628d7fc6b99fb59244)
+++ guiframe/local_perspectives/plotting/Plotter1D.py	(revision 6c0568bd80268d53159740762af718581163832a)
@@ -58,12 +58,11 @@
         ## save errors dy  for each data plotted
         self.err_dy={}
+        ## flag to determine if the hide or show context menu item should
+        ## be displayed
         self.errors_hide=0
-        
         ## Unique ID (from gui_manager)
         self.uid = None
-        
         ## Action IDs for internal call-backs
         self.action_ids = {}
-        
         ## Graph        
         self.graph = Graph()
@@ -72,4 +71,5 @@
         self.graph.render(self)
    
+   
     def _reset(self):
         """
@@ -80,4 +80,5 @@
         self.action_ids = {}
     
+    
     def _onEVT_1DREPLOT(self, event):
         """
@@ -87,5 +88,4 @@
        
         #TODO: Check for existence of plot attribute
-
         # Check whether this is a replot. If we ask for a replot
         # and the plottable no longer exists, ignore the event.
@@ -107,6 +107,4 @@
                 is_new = False
         
-            
-           
         if is_new:
             # a new plottable overwrites a plotted one  using the same id
@@ -126,25 +124,22 @@
                 self.plots[event.plot.name].dx = event.plot.dx    
  
-        
-        # Check axis labels
         #TODO: Should re-factor this
-        #if event.plot._xunit != self.graph.prop["xunit"]:
-        self.errors_hide=0
+        ## for all added plot the option to hide error show be displayed first
+        self.errors_hide = 0
+        ## Set axis labels
         self.graph.xaxis(event.plot._xaxis, event.plot._xunit)
-            
-        #if event.plot._yunit != self.graph.prop["yunit"]:
         self.graph.yaxis(event.plot._yaxis, event.plot._yunit)
-      
-        # Set the view scale for all plots
-       
+        ## Set the view scale for all plots
         self._onEVT_FUNC_PROPERTY()
-        
+        ## render the graph
         self.graph.render(self)
-       
         self.subplot.figure.canvas.draw_idle()
         
+        
     def onLeftDown(self,event): 
-        """ left button down and ready to drag"""
-           
+        """ 
+            left button down and ready to drag
+            Display the position of the mouse on the statusbar
+        """
         PlotPanel.onLeftDown(self, event)
         ax = event.inaxes
@@ -153,9 +148,12 @@
             wx.PostEvent(self.parent, StatusEvent(status=position))
 
+
     def _onRemove(self, event):
         """
-        """
+            Remove a plottable from the graph and render the graph 
+            @param event: Menu event
+        """
+        ## Check if there is a selected graph to remove
         if not self.graph.selected_plottable == None:
-            #print self.graph.selected_plottable
             self.graph.delete(self.plots[self.graph.selected_plottable])
             del self.plots[self.graph.selected_plottable]
@@ -169,12 +167,7 @@
             @param event: wx context event
         """
-        #slicerpop = wx.Menu()
         slicerpop = PanelMenu()
         slicerpop.set_plots(self.plots)
         slicerpop.set_graph(self.graph)
-                
-        # Option to save the data displayed
-        
-      
                 
         # Various plot options
@@ -193,5 +186,5 @@
         slicerpop.AppendSeparator()
         item_list = self.parent.get_context_menu(self.graph)
-        #print "item_list",item_list
+       
         if (not item_list==None) and (not len(item_list)==0):
             for item in item_list:
@@ -201,23 +194,23 @@
                     wx.EVT_MENU(self, id, item[2])
                 except:
+                    wx.PostEvent(self.parent, StatusEvent(status=\
+                        "ModelPanel1D.onContextMenu: bad menu item  %s"%sys.exc_value))
                     pass
-                    #print sys.exc_value
-                    #print RuntimeError, "View1DPanel.onContextMenu: bad menu item"
             slicerpop.AppendSeparator()
-        #for plot in self.graph.plottables:
+        
         if self.graph.selected_plottable in self.plots:
             plot = self.plots[self.graph.selected_plottable]
             id = wx.NewId()
             name = plot.name
+           
             slicerpop.Append(id, "&Save %s points" % name)
             self.action_ids[str(id)] = plot
             wx.EVT_MENU(self, id, self._onSave)
-            #save as cansas
+            
             id = wx.NewId()
             slicerpop.Append(id, "&Save %s canSAS XML" % name)
             self.action_ids[str(id)] = plot
             wx.EVT_MENU(self, id, self._onSaveXML)
-                
-            # Option to delete plottable
+           
             id = wx.NewId()
             slicerpop.Append(id, "Remove %s curve" % name)
@@ -227,27 +220,19 @@
             # Option to hide
             #TODO: implement functionality to hide a plottable (legend click)
-            
        
         if self.graph.selected_plottable in self.plots:
             if self.plots[self.graph.selected_plottable].name in self.err_dy.iterkeys()\
                 and self.errors_hide==1:
-                 
-                #if self.plots[self.graph.selected_plottable].__class__.__name__=="Theory1D":
+                
                 id = wx.NewId()
                 slicerpop.Append(id, '&Show errors to data')
-                #print "panel scale before  ",self.xLabel, self.yLabel
-                #print "cyllinder before adding error", self.plots[self.graph.selected_plottable].x
                 wx.EVT_MENU(self, id, self._on_add_errors)
                 
-               
             elif self.plots[self.graph.selected_plottable].__class__.__name__=="Data1D"\
                 and self.errors_hide==0:
+                   
                     id = wx.NewId()
                     slicerpop.Append(id, '&Hide Error bars')
-                    #print "panel scale before  ",self.xLabel, self.yLabel
-                    #print "cyllinder before adding error", self.plots[self.graph.selected_plottable].x
                     wx.EVT_MENU(self, id, self._on_remove_errors)
-                    
-             
             else:
                 id = wx.NewId()
@@ -256,14 +241,13 @@
                 
             slicerpop.AppendSeparator()
+        
         id = wx.NewId()
         slicerpop.Append(id, '&Change scale')
         wx.EVT_MENU(self, id, self._onProperties)
-        
+       
         id = wx.NewId()
         slicerpop.Append(id, '&Reset Graph')
         wx.EVT_MENU(self, id, self.onResetGraph)  
        
-        
-
         pos = event.GetPosition()
         pos = self.ScreenToClient(pos)
@@ -272,8 +256,18 @@
         
     def _on_remove_errors(self, evt):
+        """
+            Save name and dy of data in dictionary self.err_dy
+            Create a new data1D with the same x, y
+            vector and dy with zeros.
+            post self.err_dy as event (ErrorDataEvent) for any object
+            which wants to reconstruct the initial data.
+            @param evt: Menu event
+        """
         if not self.graph.selected_plottable == None:
+            ## store existing dy
             name =self.plots[self.graph.selected_plottable].name
             dy = self.plots[self.graph.selected_plottable].dy
             self.err_dy[name]= dy
+            ## Create a new dy for a new plottable
             import numpy
             dy= numpy.zeros(len(self.plots[self.graph.selected_plottable].y))
@@ -282,5 +276,5 @@
                               dy=dy)
             new_plot.interactive = True
-            self.errors_hide=1
+            self.errors_hide = 1
             new_plot.name = self.plots[self.graph.selected_plottable].name 
             if hasattr(self.plots[self.graph.selected_plottable], "group_id"):
@@ -294,15 +288,14 @@
             label, unit = self.plots[self.graph.selected_plottable].get_yaxis()
             new_plot.yaxis(label, unit)
-            #print "panel scale ",self.xLabel, self.yLabel
-            #print "color",self.graph.plottables[self.plots[self.graph.selected_plottable]]
+            ## save the color of the selected plottable before it is deleted
             color=self.graph.plottables[self.plots[self.graph.selected_plottable]]
             self.graph.delete(self.plots[self.graph.selected_plottable])
-            
+            ## add newly created plottable to the graph with the save color
             self.graph.add(new_plot,color)
-            # transforming the view of the new data into the same of the previous data
+            ## transforming the view of the new data into the same of the previous data
             self._onEVT_FUNC_PROPERTY()
-            #print "cyllinder", self.plots[self.graph.selected_plottable].x,self.plots[self.graph.selected_plottable].view.x, new_plot.x, new_plot.view.x
+            ## save the plot 
             self.plots[self.graph.selected_plottable]=new_plot
-           
+            ## Render the graph
             self.graph.render(self)
             self.subplot.figure.canvas.draw_idle() 
@@ -311,8 +304,12 @@
             wx.PostEvent(self.parent, event)
     
+    
     def _on_add_errors(self, evt):
         """
+            create a new data1D witht the errors saved in self.err_dy
+            to show errors of the plot.
             Compute reasonable errors for a data set without 
             errors and transorm the plottable to a Data1D
+            @param evt: Menu event
         """
         import math
@@ -321,4 +318,7 @@
         
         if not self.graph.selected_plottable == None:
+            ##Reset the flag to display the hide option on the context menu
+            self.errors_hide = 0
+            ## restore dy 
             length = len(self.plots[self.graph.selected_plottable].x)
             dy = numpy.zeros(length)
@@ -329,12 +329,10 @@
                 for i in range(length):
                     dy[i] = math.sqrt(self.plots[self.graph.selected_plottable].y[i])      
-            #for i in range(length):
-            #    dy[i] = math.sqrt(self.plots[self.graph.selected_plottable].y[i])
-                
+            ## Create a new plottable data1D
             new_plot = Data1D(self.plots[self.graph.selected_plottable].x,
                               self.plots[self.graph.selected_plottable].y,
                               dy=dy)
             new_plot.interactive = True
-            self.errors_hide=0
+           
             new_plot.name = self.plots[self.graph.selected_plottable].name 
             if hasattr(self.plots[self.graph.selected_plottable], "group_id"):
@@ -349,18 +347,23 @@
             label, unit = self.plots[self.graph.selected_plottable].get_yaxis()
             new_plot.yaxis(label, unit)
-            #print "panel scale ",self.xLabel, self.yLabel
+            ## save the color of the selected plottable before it is deleted
             color=self.graph.plottables[self.plots[self.graph.selected_plottable]]
             self.graph.delete(self.plots[self.graph.selected_plottable])
+            ## add newly created plottable to the graph with the save color
             self.graph.add(new_plot, color)
-            
-            # transforming the view of the new data into the same of the previous data
+            ## transforming the view of the new data into the same of the previous data
             self._onEVT_FUNC_PROPERTY()
-            #print "cyllinder", self.plots[self.graph.selected_plottable].x,self.plots[self.graph.selected_plottable].view.x, new_plot.x, new_plot.view.x
+            ## save the plot 
             self.plots[self.graph.selected_plottable]=new_plot
-            
+            ## render the graph with its new content
             self.graph.render(self)
             self.subplot.figure.canvas.draw_idle() 
                
+               
     def _onSaveXML(self, evt):
+        """
+            Save 1D  Data to  XML file
+            @param evt: Menu event
+        """
         import os
         id = str(evt.GetId())
@@ -371,5 +374,4 @@
                 path = dlg.GetPath()
                 mypath = os.path.basename(path)
-                #print path
             dlg.Destroy()
             
@@ -381,6 +383,5 @@
                 reader.write( path, datainfo)
             return 
-                
-                
+                      
                 
                 
@@ -399,5 +400,5 @@
                 path = dlg.GetPath()
                 mypath = os.path.basename(path)
-                #print path
+                
             dlg.Destroy()
             
@@ -412,5 +413,5 @@
                     try:
                         if len(self.action_ids[id].y) != len(self.action_ids[id].dy):
-                            #print "Y and dY have different lengths"
+    
                             has_errors = False
                     except:
@@ -433,11 +434,4 @@
                 out.close()
     
- 
-
-    def _onToggleScale(self, event):
-        if self.get_yscale() == 'log':
-            self.set_yscale('linear')
-        else:
-            self.set_yscale('log')
-        self.subplot.figure.canvas.draw_idle()    
-       
+    
+       
Index: guiframe/local_perspectives/plotting/Plotter2D.py
===================================================================
--- guiframe/local_perspectives/plotting/Plotter2D.py	(revision eba08f1a43992e4ce1b52d3a3dd206926fdeb56a)
+++ guiframe/local_perspectives/plotting/Plotter2D.py	(revision 6c0568bd80268d53159740762af718581163832a)
@@ -60,26 +60,26 @@
         ## Reference to the parent window
         self.parent = parent
-        ## Plottables
+        ## Dictionary containing Plottables
         self.plots = {}
-        self.data2D= data2d
-        self.data =data2d.data
+        ## Save reference of the current plotted 
+        self.data2D = data2d
         ## Unique ID (from gui_manager)
         self.uid = None
-        
         ## Action IDs for internal call-backs
         self.action_ids = {}
+        ## Create Artist and bind it
         self.connect = BindArtist(self.subplot.figure)
-        
-        # Beam stop
+        ## Beam stop
         self.beamstop_radius = DEFAULT_BEAM
-       
+        ## to set the order of lines drawn first.
         self.slicer_z = 5
+        ## Reference to the current slicer
         self.slicer = None
-        #self.parent.Bind(EVT_INTERNAL, self._onEVT_INTERNAL)
+        ## event to send slicer info 
         self.Bind(EVT_INTERNAL, self._onEVT_INTERNAL)
+        
         self.axes_frozen = False
-        
+        ## panel that contains result from slicer motion (ex: Boxsum info)
         self.panel_slicer=None
-        #self.parent.Bind(EVT_SLICER_PARS, self.onParamChange)
         ## Graph        
         self.graph = Graph()
@@ -87,14 +87,5 @@
         self.graph.yaxis("\\rm{Intensity} ","cm^{-1}")
         self.graph.render(self)
-        #self.Bind(boxSum.EVT_SLICER_PARS_UPDATE, self._onEVT_SLICER_PARS)
-        #self.Bind(EVT_SLICER_PARS, self._onEVT_SLICER_PARS)
-       
-        
-        
-    def _onEVT_SLICER_PARS(self, event):
-        #print "paramaters entered on slicer panel", event.type, event.params
-        self.slicer.set_params(event.params)
-        #from sans.guicomm.events import SlicerPanelEvent
-        #wx.PostEvent(self.parent, SlicerPanelEvent (panel= self.panel_slicer))
+        
         
     def _onEVT_1DREPLOT(self, event):
@@ -108,9 +99,8 @@
             @param event: data event
         """
-              
-        self.data2D= event.plot
-        self.data =event.plot.data
+        ## Update self.data2d with the current plot
+        self.data2D = event.plot
         #TODO: Check for existence of plot attribute
-
+        
         # Check whether this is a replot. If we ask for a replot
         # and the plottable no longer exists, ignore the event.
@@ -157,11 +147,8 @@
             
         self.slicer= None
-       
         # Check axis labels
         #TODO: Should re-factor this
-        #if event.plot._xunit != self.graph.prop["xunit"]:
+        ## render the graph with its new content
         self.graph.xaxis(event.plot._xaxis, event.plot._xunit)
-            
-        #if event.plot._yunit != self.graph.prop["yunit"]:
         self.graph.yaxis(event.plot._yaxis, event.plot._yunit)
         self.graph.title(self.data2D.name)
@@ -175,6 +162,4 @@
             @param event: wx context event
         """
-        
-        #slicerpop = wx.Menu()
         slicerpop = PanelMenu()
         slicerpop.set_plots(self.plots)
@@ -204,8 +189,7 @@
                         wx.EVT_MENU(self, id, item[2])
                     except:
+                        wx.PostEvent(self.parent, StatusEvent(status=\
+                        "ModelPanel1D.onContextMenu: bad menu item  %s"%sys.exc_value))
                         pass
-                        #print sys.exc_value
-                        #print RuntimeError, "View1DPanel2D.onContextMenu: bad menu item"
-        
                 slicerpop.AppendSeparator()
         
@@ -237,12 +221,15 @@
         slicerpop.Append(id, '&Box averaging in Qy')
         wx.EVT_MENU(self, id, self.onBoxavgY) 
+        
         if self.slicer !=None :
             id = wx.NewId()
             slicerpop.Append(id, '&Clear slicer')
             wx.EVT_MENU(self, id,  self.onClearSlicer) 
+            
             if self.slicer.__class__.__name__ !="BoxSum":
                 id = wx.NewId()
                 slicerpop.Append(id, '&Edit Slicer Parameters')
                 wx.EVT_MENU(self, id, self._onEditSlicer) 
+                
         slicerpop.AppendSeparator() 
        
@@ -255,10 +242,14 @@
         self.PopupMenu(slicerpop, pos)
    
+   
     def _onEditDetector(self, event):
         """
-        """
-        #print "edit detortor param",self.zmin_2D, self.zmax_2D
+            Allow to view and edits  detector parameters
+            @param event: wx.menu event
+        """
+        
         import detector_dialog
         dialog = detector_dialog.DetectorDialog(self, -1,base=self.parent)
+        ## info of current detector and data2D
         xnpts = len(self.data2D.x_bins)
         ynpts = len(self.data2D.y_bins)
@@ -269,4 +260,5 @@
         zmin = self.zmin_2D
         zmax = self.zmax_2D
+        ## set dialog window content
         dialog.setContent(xnpts=xnpts,ynpts=ynpts,qmax=qmax,
                            beam=self.data2D.xmin,
@@ -279,5 +271,5 @@
        
         dialog.Destroy()
-        #print "zmn ,zmax", self.zmin_2D, self.zmax_2D
+        ## Redraw the current image
         self.image(data= self.data2D.data,
                    xmin= self.data2D.xmin,
@@ -288,14 +280,8 @@
                    zmax= self.zmax_2D,
                    color=0,symbol=0,label='data2D')
-        #self.graph.render(self)
         self.subplot.figure.canvas.draw_idle()
         
-    def get_corrected_data(self):
-        # Protect against empty data set
-        if self.data == None:
-            return None
-        import copy
-        output = copy.deepcopy(self.data)
-        return output
+        
+  
     def freeze_axes(self):
         self.axes_frozen = True
@@ -307,5 +293,6 @@
         pass
     def onWheel(self, event):
-        pass    
+        pass  
+      
     def update(self, draw=True):
         """
@@ -313,9 +300,11 @@
             profiles and resetting the widgets.
         """
-        #self.slicer.update()
         self.draw()
         
         
     def _getEmptySlicerEvent(self):
+        """
+            create an empty slicervent 
+        """
         return SlicerEvent(type=None,
                            params=None,
@@ -323,27 +312,30 @@
     def _onEVT_INTERNAL(self, event):
         """
-            I don't understand why Unbind followed by a Bind
-            using a modified self.slicer doesn't work.
-            For now, I post a clear event followed by
-            a new slicer event...
+            Draw the slicer
+            @param event: wx.lib.newevent (SlicerEvent) containing slicer
+            parameter
         """
         self._setSlicer(event.slicer)
             
     def _setSlicer(self, slicer):
-        # Clear current slicer
-        #printEVT("Plotter2D._setSlicer %s" % slicer)
-        
+        """
+            Clear the previous slicer and create a new one.Post an internal
+            event.
+            @param slicer: slicer class to create
+        """
+        
+        ## Clear current slicer
         if not self.slicer == None:  
             self.slicer.clear()            
-            
+        ## Create a new slicer    
         self.slicer_z += 1
         self.slicer = slicer(self, self.subplot, zorder=self.slicer_z)
-        #print "come here"
         self.subplot.set_ylim(self.data2D.ymin, self.data2D.ymax)
         self.subplot.set_xlim(self.data2D.xmin, self.data2D.xmax)
-       
+        ## Draw slicer
         self.update()
         self.slicer.update()
-        
+        wx.PostEvent(self.parent, StatusEvent(status=\
+                        "Plotter2D._setSlicer  %s"%self.slicer.__class__.__name__))
         # Post slicer event
         event = self._getEmptySlicerEvent()
@@ -352,27 +344,24 @@
         event.obj_class = self.slicer.__class__
         event.params = self.slicer.get_params()
-        #print "Plotter2D: event.type",event.type,event.params, self.parent
-        
-        #wx.PostEvent(self.parent, event)
         wx.PostEvent(self, event)
 
+
     def onCircular(self, event):
         """
             perform circular averaging on Data2D
+            @param event: wx.menu event
         """
         
         from DataLoader.manipulations import CircularAverage
-        import math
+        ## compute the maximum radius of data2D
         self.qmax= max(math.fabs(self.data2D.xmax),math.fabs(self.data2D.xmin))
         self.ymax=max(math.fabs(self.data2D.ymax),math.fabs(self.data2D.ymin))
         self.radius= math.sqrt( math.pow(self.qmax,2)+math.pow(self.ymax,2)) 
-        #print "radius?",self.radius
-        # bin_width = self.qmax -self.qmin/nbins 
-        #nbins= 30
+        ##Compute beam width
         bin_width = (self.qmax +self.qmax)/100
-        
+        ## Create data1D circular average of data2D
         Circle = CircularAverage( r_min=0, r_max=self.radius, bin_width=bin_width)
-       
         circ = Circle(self.data2D)
+        
         from sans.guiframe.dataFitting import Data1D
         if hasattr(circ,"dxl"):
@@ -390,21 +379,24 @@
         #new_plot.info=self.data2D.info
         new_plot.interactive = True
-        #print "loader output.detector",output.source
         new_plot.detector =self.data2D.detector
-        
-        # If the data file does not tell us what the axes are, just assume...
+        ## If the data file does not tell us what the axes are, just assume...
         new_plot.xaxis("\\rm{Q}","A^{-1}")
         new_plot.yaxis("\\rm{Intensity} ","cm^{-1}")
         new_plot.group_id = "Circ avg "+ self.data2D.name
         new_plot.id = "Circ avg "+ self.data2D.name
-        self.scale = 'log'
-       
+        
         wx.PostEvent(self.parent, NewPlotEvent(plot=new_plot, title=new_plot.name))
        
+       
     def _onEditSlicer(self, event):
+        """
+            Is available only when a slicer is drawn.Create a dialog 
+            window where the user can enter value to reset slicer
+            parameters.
+            @param event: wx.menu event
+        """
         if self.slicer !=None:
             from SlicerParameters import SlicerParameterPanel
             dialog = SlicerParameterPanel(self, -1, "Slicer Parameters")
-            #dialog = SlicerParameterPanel(self.parent, -1, "Slicer Parameters")
             dialog.set_slicer(self.slicer.__class__.__name__,
                             self.slicer.get_params())
@@ -412,21 +404,19 @@
                 dialog.Destroy() 
         
+        
     def onSectorQ(self, event):
         """
-            Perform sector averaging on Q
-        """
-        #print "onsector self.data2Dxmax",self.data2D.xmax, self.parent
+            Perform sector averaging on Q and draw sector slicer
+        """
         from SectorSlicer import SectorInteractor
         self.onClearSlicer(event)
-        #wx.PostEvent(self.parent, InternalEvent(slicer= SectorInteractor))
         wx.PostEvent(self, InternalEvent(slicer= SectorInteractor))
         
     def onSectorPhi(self, event):
         """
-            Perform sector averaging on Phi
+            Perform sector averaging on Phi and draw annulus slicer
         """
         from AnnulusSlicer import AnnulusInteractor
         self.onClearSlicer(event)
-        #wx.PostEvent(self.parent, InternalEvent(slicer= AnnulusInteractor))
         wx.PostEvent(self, InternalEvent(slicer= AnnulusInteractor))
         
@@ -434,10 +424,8 @@
         from boxSum import BoxSum
         self.onClearSlicer(event)
-        #wx.PostEvent(self.parent, InternalEvent(slicer= BoxSum))
-        if not self.slicer == None:  
-            self.slicer.clear()             
+                    
         self.slicer_z += 1
         self.slicer =  BoxSum(self, self.subplot, zorder=self.slicer_z)
-        #print "come here"
+       
         self.subplot.set_ylim(self.data2D.ymin, self.data2D.ymax)
         self.subplot.set_xlim(self.data2D.xmin, self.data2D.xmax)
@@ -445,39 +433,45 @@
         self.update()
         self.slicer.update()
-        
-        # Post slicer event
-        event = self._getEmptySlicerEvent()
-        event.type = self.slicer.__class__.__name__
-        
-        
-        event.obj_class = self.slicer.__class__
-        event.params = self.slicer.get_params()
-        #print "Plotter2D: event.type",event.type,event.params, self.parent
-        
+        ## Value used to initially set the slicer panel
+        type = self.slicer.__class__.__name__
+        params = self.slicer.get_params()
+        ## Create a new panel to display results of summation of Data2D
         from slicerpanel import SlicerPanel
-        new_panel = SlicerPanel(parent= self.parent,id= -1,base= self,type=event.type,
-                                 params=event.params, style=wx.RAISED_BORDER)
-        #new_panel.set_slicer(self.slicer.__class__.__name__,
-        new_panel.window_caption=str(self.slicer_z)+self.slicer.__class__.__name__+" "+ str(self.data2D.name)
-        new_panel.window_name = str(self.slicer_z)+self.slicer.__class__.__name__+" "+ str(self.data2D.name)
+        new_panel = SlicerPanel(parent= self.parent, id= -1,
+                                    base= self, type= type,
+                                    params= params, style= wx.RAISED_BORDER)
+        
+        new_panel.window_caption=self.slicer.__class__.__name__+" "+ str(self.data2D.name)
+        new_panel.window_name = self.slicer.__class__.__name__+" "+ str(self.data2D.name)
+        ## Store a reference of the new created panel
         self.panel_slicer= new_panel
+        ## save the window_caption of the new panel in the current slicer
         self.slicer.set_panel_name( name= new_panel.window_caption)
-        #wx.PostEvent(self.panel_slicer, event)
+        ## post slicer panel to guiframe to display it 
         from sans.guicomm.events import SlicerPanelEvent
         wx.PostEvent(self.parent, SlicerPanelEvent (panel= self.panel_slicer))
-        #print "finish box sum"
+
         
     def onBoxavgX(self,event):
+        """
+            Perform 2D data averaging on Qx
+            Create a new slicer .
+            @param event: wx.menu event
+        """
         from boxSlicer import BoxInteractorX
         self.onClearSlicer(event)
-        #wx.PostEvent(self.parent, InternalEvent(slicer= BoxInteractorX))
         wx.PostEvent(self, InternalEvent(slicer= BoxInteractorX))
        
        
     def onBoxavgY(self,event):
+        """
+            Perform 2D data averaging on Qy
+            Create a new slicer .
+            @param event: wx.menu event
+        """
         from boxSlicer import BoxInteractorY
         self.onClearSlicer(event)
         wx.PostEvent(self, InternalEvent(slicer= BoxInteractorY))
-        #wx.PostEvent(self.parent, InternalEvent(slicer= BoxInteractorY))
+        
         
     def onClearSlicer(self, event):
@@ -492,9 +486,7 @@
             # Post slicer None event
             event = self._getEmptySlicerEvent()
-            #wx.PostEvent(self.parent, event)
             wx.PostEvent(self, event)
           
-  
-        
+    
     def _onToggleScale(self, event):
         """
@@ -505,5 +497,5 @@
         else:
             self.scale = 'log'
-        self.image(self.data,self.xmin_2D,self.xmax_2D,self.ymin_2D,
+        self.image(self.data2D.data,self.xmin_2D,self.xmax_2D,self.ymin_2D,
                    self.ymax_2D,self.zmin_2D ,self.zmax_2D )
         wx.PostEvent(self.parent, StatusEvent(status="Image is in %s scale"%self.scale))
Index: guiframe/local_perspectives/plotting/SectorSlicer.py
===================================================================
--- guiframe/local_perspectives/plotting/SectorSlicer.py	(revision 1a6ec25b866f58bfe4c760280dd49feb91a201e9)
+++ guiframe/local_perspectives/plotting/SectorSlicer.py	(revision 6c0568bd80268d53159740762af718581163832a)
@@ -13,37 +13,37 @@
 
 from BaseInteractor import _BaseInteractor
-from sans.guicomm.events import NewPlotEvent, StatusEvent,SlicerParameterEvent,EVT_SLICER_PARS
-
-
-
-
+from sans.guicomm.events import NewPlotEvent, StatusEvent
+from sans.guicomm.events import SlicerParameterEvent,EVT_SLICER_PARS
 
 
 class SectorInteractor(_BaseInteractor):
     """
-         Select an annulus through a 2D plot
+         Draw a sector slicer.Allow to performQ averaging on data 2D
     """
     def __init__(self,base,axes,color='black', zorder=3):
         
         _BaseInteractor.__init__(self, base, axes, color=color)
+        ## Class initialization
         self.markers = []
-        self.axes = axes        
-        self.qmax = math.sqrt(math.pow(max(self.base.data2D.xmax,math.fabs(self.base.data2D.xmin)),2)+math.pow(max(self.base.data2D.xmax,math.fabs(self.base.data2D.xmin)),2))
-        #print "sector qmax", self.qmax
+        self.axes = axes   
+        ## connect the plot to event 
         self.connect = self.base.connect
         
+        ## compute qmax limit to reset the graph     
+        x = math.pow(max(self.base.data2D.xmax,math.fabs(self.base.data2D.xmin)),2)
+        y = math.pow(max(self.base.data2D.ymax,math.fabs(self.base.data2D.ymin)),2)
+        self.qmax= math.sqrt(x + y)
         ## Number of points on the plot
         self.nbins = 20
-        self.theta1= math.pi/4
+        ## Angle of the middle line
         self.theta2= math.pi/3
+        ## Absolute value of the Angle between the middle line and any side line
         self.phi=math.pi/12
-        #self.theta3= 2*self.theta2 -self.theta1
-        # Inner circle
-        self.main_line = LineInteractor(self, self.base.subplot,color='green', zorder=zorder, r=self.qmax,
+        
+        ## Middle line
+        self.main_line = LineInteractor(self, self.base.subplot,color='blue', zorder=zorder, r=self.qmax,
                                            theta= self.theta2)
         self.main_line.qmax = self.qmax
-        #self.left_line = SectionInteractor(self, self.base.subplot, zorder=zorder+1, r=self.qmax,
-        #                                   theta1= self.theta1, theta2= self.theta2)
-        #self.left_line.qmax = self.base.qmax
+        ## Right Side line
         self.right_line= SideInteractor(self, self.base.subplot,color='black', zorder=zorder,
                                      r=self.qmax,
@@ -51,20 +51,24 @@
                                            theta2=self.theta2)
         self.right_line.qmax = self.qmax
-        self.left_line= SideInteractor(self, self.base.subplot,color='blue', zorder=zorder,
+        ## Left Side line 
+        self.left_line= SideInteractor(self, self.base.subplot,color='black', zorder=zorder,
                                      r=self.qmax,
                                            phi= self.phi,
                                            theta2=self.theta2)
         self.left_line.qmax = self.qmax
-        #self.outer_circle.set_cursor(self.base.qmax/1.8, 0)
-        
-                      
+        ## draw the sector               
         self.update()
         self._post_data()
-        
-        # Bind to slice parameter events
+
+        ## Bind to slice parameter events
         self.base.Bind(EVT_SLICER_PARS, self._onEVT_SLICER_PARS)
 
+
     def _onEVT_SLICER_PARS(self, event):
-       
+        """
+            receive an event containing parameters values to reset the slicer
+            @param event: event of type SlicerParameterEvent with params as 
+            attribute
+        """
         wx.PostEvent(self.base.parent, StatusEvent(status="SectorSlicer._onEVT_SLICER_PARS"))
         event.Skip()
@@ -73,23 +77,18 @@
             self.base.update()
 
-    def update_and_post(self):
-        self.update()
-        #self._post_data()
-
-    def save_data(self, path, image, x, y):
-        output = open(path, 'w')
-        
-        data_x, data_y = self.get_data(image, x, y)
-        
-        output.write("<phi>  <average>\n")
-        for i in range(len(data_x)):
-            output.write("%g  %g\n" % (data_x[i], data_y[i]))
-        output.close()
 
     def set_layer(self, n):
+        """
+             Allow adding plot to the same panel
+             @param n: the number of layer
+        """
         self.layernum = n
         self.update()
         
+        
     def clear(self):
+        """
+            Clear the slicer and all connected events related to this slicer
+        """
         self.clear_markers()
         self.main_line.clear()
@@ -97,43 +96,36 @@
         self.right_line.clear()
         self.base.connect.clearall()
-        
         self.base.Unbind(EVT_SLICER_PARS)
         
+        
     def update(self):
         """
-        Respond to changes in the model by recalculating the profiles and
-        resetting the widgets.
-        """
-        # Update locations        
-        
-        #if self.main_line.has_move:
-        #self.main_line.update()   
-        #self.right_line.update()    
-        #self.left_line.update()     
+            Respond to changes in the model by recalculating the profiles and
+            resetting the widgets.
+        """
+        # Update locations  
+        ## Check if the middle line was dragged and update the picture accordingly     
         if self.main_line.has_move:
             self.main_line.update()
-            #print "main_theta--->",self.main_line.get_radius()*180/3.14
-            self.right_line.update( delta = -self.left_line.phi/2+math.pi,mline= self.main_line.theta)
-            #print "main_theta--->",self.main_line.get_radius()*180/3.14
-            self.left_line.update( delta = self.left_line.phi/2+math.pi ,mline= self.main_line.theta)
-            #print "main_theta--->",self.main_line.get_radius()*180/3.14
-            #print "Main line has moved ---> phi right",math.degrees(self.main_line.theta),math.degrees(self.main_line.get_radius()),math.degrees(self.main_line.get_radius()+self.right_line.theta)
-            #print "Main line has moved ---> phi left",math.degrees(self.left_line.theta+self.main_line.get_radius())
+            self.right_line.update( delta= -self.left_line.phi/2+math.pi ,
+                                    mline= self.main_line.theta )
+            self.left_line.update( delta = self.left_line.phi/2+math.pi ,
+                                   mline= self.main_line.theta )
+        ## Check if the left side has moved and update the slicer accordingly  
         if self.left_line.has_move:
-            #print "left line has moved --->"
             self.main_line.update()
-            self.left_line.update(phi=None,delta=None, mline=self.main_line,side=True, left=True)
-            #self.right_line.update(-1*delta,linem=self.main_line,linel=self.left_line)
-            self.right_line.update(phi=self.left_line.phi,delta=None, mline=self.main_line,side=True,left=False, right=True)
-        
+            self.left_line.update( phi=None, delta=None, mline=self.main_line ,
+                                  side=True, left=True )
+            self.right_line.update( phi= self.left_line.phi, delta= None,
+                                     mline= self.main_line, side= True,
+                                     left=False, right= True )
+        ## Check if the right side line has moved and update the slicer accordingly
         if self.right_line.has_move:
-        
             self.main_line.update()
-            self.right_line.update(phi=None,delta=None, mline=self.main_line,side=True, left=False,right=True)
-            #print "right line has moved --->",self.right_line.phi
-            self.left_line.update(phi=self.right_line.phi,delta=None, mline=self.main_line,side=True, left=False)
-   
-        
-    
+            self.right_line.update( phi=None, delta=None, mline=self.main_line,
+                                   side=True, left=False, right=True )
+            self.left_line.update( phi=self.right_line.phi, delta=None,
+                                    mline=self.main_line, side=True, left=False )
+
 
     def save(self, ev):
@@ -143,31 +135,32 @@
         """
         self.base.freeze_axes()
-        self.inner_circle.save(ev)
-        self.outer_circle.save(ev)
+        self.main_line.save(ev)
+        self.right_line.save(ev)
+        self.left_line.save(ev)
 
     def _post_data(self, nbins=None):
-        # Compute data
+        """
+            compute sector averaging of data2D into data1D
+            @param nbins: the number of point to plot for the average 1D data
+        """
+        ## get the data2D to average
         data = self.base.data2D
         # If we have no data, just return
         if data == None:
             return
-
-        name = "Sector "
+        ## Averaging
         from DataLoader.manipulations import SectorQ
-        radius = self.qmax #radius=math.sqrt(math.pow(self.qmax,2)+math.pow(self.qmax,2))
-        phimin =  -self.left_line.phi+self.main_line.theta
-        phimax = self.left_line.phi+self.main_line.theta
-        #phimin = min(self.right_line.theta+math.pi,self.left_line.theta+math.pi)
-        #phimax = max(self.right_line.theta+math.pi,self.left_line.theta+math.pi)
-        #print "sector Q angles=",phimin*180/math.pi,phimax*180/math.pi,self.main_line.theta*180/math.pi
-        #phi must be 0 to 2pi with cut-off line sts on the left.
+        radius = self.qmax 
+        phimin =  -self.left_line.phi + self.main_line.theta
+        phimax = self.left_line.phi + self.main_line.theta
+       
         if nbins==None:
             nbins = 20
-        sect = SectorQ(r_min=0.0, r_max= radius , phi_min=phimin+math.pi, phi_max=phimax+math.pi, nbins=nbins)
-        #sect = SectorQ(r_min=-1*radius , r_max= radius , phi_min=phimin, phi_max=phimax)
-        
-        
+        sect = SectorQ(r_min= 0.0, r_max= radius ,
+                        phi_min= phimin + math.pi,
+                        phi_max= phimax + math.pi, nbins=nbins)
+     
         sector = sect(self.base.data2D)
-        
+        ##Create 1D data resulting from average
         from sans.guiframe.dataFitting import Data1D
         if hasattr(sector,"dxl"):
@@ -183,12 +176,8 @@
         new_plot.name = "SectorQ" +"("+ self.base.data2D.name+")"
         
-       
-
         new_plot.source=self.base.data2D.source
         #new_plot.info=self.base.data2D.info
         new_plot.interactive = True
-        #print "loader output.detector",self.base.data2D.info,output.source,
         new_plot.detector =self.base.data2D.detector
-        #print "loader output.detector",new_plot.detector
         # If the data file does not tell us what the axes are, just assume...
         new_plot.xaxis("\\rm{Q}", 'A^{-1}')
@@ -202,13 +191,16 @@
         
     def moveend(self, ev):
+        """
+            Called a dragging motion ends.Get slicer event 
+        """
         self.base.thaw_axes()
-        
-        # Post paramters
+        ## Post parameters
         event = SlicerParameterEvent()
         event.type = self.__class__.__name__
         event.params = self.get_params()
-        #wx.PostEvent(self.base.parent, event)
+        ## Send slicer paramers to plotter2D
         wx.PostEvent(self.base, event)
         self._post_data()
+            
             
     def restore(self):
@@ -226,35 +218,54 @@
         pass
         
+        
     def set_cursor(self, x, y):
         pass
         
+        
     def get_params(self):
+        """
+            Store a copy of values of parameters of the slicer into a dictionary.
+            @return params: the dictionary created
+        """
         params = {}
-        params["Phi"] = self.main_line.theta
+        ## Always make sure that the left and the right line are at phi 
+        ## angle of the middle line
         if math.fabs(self.left_line.phi) != math.fabs(self.right_line.phi):
             raise ValueError,"Phi left and phi right are different %f, %f"%(self.left_line.phi, self.right_line.phi)
+        
+        params["Phi"] = self.main_line.theta
         params["Delta_Phi"] = math.fabs(self.left_line.phi)
         params["nbins"] = self.nbins
         return params
     
+    
     def set_params(self, params):
-        
+        """
+            Receive a dictionary and reset the slicer with values contained 
+            in the values of the dictionary.
+            @param params: a dictionary containing name of slicer parameters and 
+            values the user assigned to the slicer.
+        """
         main = params["Phi"] 
         phi = math.fabs(params["Delta_Phi"] )
         self.nbins = int(params["nbins"])
         self.main_line.theta= main
-        
+        ## Reset the slicer parameters
         self.main_line.update()
-        self.right_line.update(phi=phi,delta=None, mline=self.main_line,side=True,right=True)
-        self.left_line.update(phi=phi,delta=None, mline=self.main_line,side=True)
-       
+        self.right_line.update( phi=phi,delta=None, mline=self.main_line,
+                               side=True, right=True )
+        self.left_line.update( phi=phi, delta=None, mline=self.main_line, side=True )
+        ## post the new corresponding data
         self._post_data(nbins=self.nbins)
+        
         
     def freeze_axes(self):
         self.base.freeze_axes()
         
+        
     def thaw_axes(self):
         self.base.thaw_axes()
 
+
     def draw(self):
         self.base.draw()
@@ -263,27 +274,32 @@
 class SideInteractor(_BaseInteractor):
     """
-         Select an annulus through a 2D plot
+        Draw an oblique line
+        @param phi: the phase between the middle line and one side line
+        @param theta2: the angle between the middle line and x- axis
     """
     def __init__(self,base,axes,color='black', zorder=5, r=1.0,phi=math.pi/4, theta2= math.pi/3):
         
         _BaseInteractor.__init__(self, base, axes, color=color)
+        ## Initialize the class
         self.markers = []
         self.axes = axes
-        
-            
+        ## compute the value of the angle between the current line and
+        ## the x-axis  
         self.save_theta = theta2 + phi
         self.theta= theta2 + phi
+        ## the value of the middle line angle with respect to the x-axis
         self.theta2 = theta2
+        ## Radius to find polar coordinates this line's endpoints
         self.radius = r
+        ## phi is the phase between the current line and the middle line
         self.phi = phi
-        self.scale = 10.0
-         # Inner circle
+        
+        ## End points polar coordinates
         x1= self.radius*math.cos(self.theta)
         y1= self.radius*math.sin(self.theta)
         x2= -1*self.radius*math.cos(self.theta)
         y2= -1*self.radius*math.sin(self.theta)
-        
+        ## defining a new marker 
         try:
-            # Inner circle marker
             self.inner_marker = self.axes.plot([x1/2.5],[y1/2.5], linestyle='',
                                           marker='s', markersize=10,
@@ -300,24 +316,32 @@
             message  = "\nTHIS PROTOTYPE NEEDS THE LATEST VERSION OF MATPLOTLIB\n"
             message += "Get the SVN version that is at least as recent as June 1, 2007"
-            
-          
-       
-       
+            owner=self.base.base.parent
+            wx.PostEvent(owner, StatusEvent(status="sectorSlicer: %s"%message))
+        
+        ## Defining the current line
         self.line = self.axes.plot([x1,x2],[y1,y2],
                                       linestyle='-', marker='',
                                       color=self.color,
                                       visible=True)[0]
+        ## Flag to differentiate the left line from the right line motion
         self.left_moving=False
-        
-        self.npts = 20
+        ## Flag to define a motion
         self.has_move=False
+        ## connecting markers and draw the picture
         self.connect_markers([self.inner_marker, self.line])
-        #self.update()
+       
 
     def set_layer(self, n):
+        """
+             Allow adding plot to the same panel
+             @param n: the number of layer
+        """
         self.layernum = n
         self.update()
         
     def clear(self):
+        """
+            Clear the slicer and all connected events related to this slicer
+        """
         self.clear_markers()
         try:
@@ -330,12 +354,10 @@
         
         
-        
-    def get_radius(self):
-        
-        return self.theta - self.save_theta
-        
-    def update(self,phi=None,delta=None, mline=None,side=False, left= False, right=False):
-        """
-        Draw the new roughness on the graph.
+    def update(self, phi=None, delta=None, mline=None,
+               side=False, left= False, right=False):
+        """
+            Draw oblique line
+            @param phi: the phase between the middle line and the current line
+            @param delta: 
         """
         #print "update left or right ", self.has_move
@@ -365,9 +387,5 @@
             theta3=self.theta2+delta
         
-            #self.phi= math.fabs(self.theta2 - (self.theta+delta))
-        #print "U:for line side theta2, phi, theta",math.degrees(self.theta2),math.degrees(self.phi),math.degrees(self.theta) 
-        #if self.theta2 >= self.theta and self.theta>=0:
-        #    print "between 0-pi",math.degrees(self.theta) 
-        
+      
         x1= self.radius*math.cos(theta3)
         y1= self.radius*math.sin(theta3)
@@ -538,16 +556,11 @@
             for item in range(len(self.axes.lines)):
                 del self.axes.lines[0]
-        
-        
-        
-    def get_radius(self):
-        
-        return self.theta - self.save_theta
-        
+  
+  
     def update(self, theta=None):
         """
         Draw the new roughness on the graph.
         """
-        #print "update main line", self.theta
+       
         if theta !=None:
             self.theta= theta
Index: guiframe/local_perspectives/plotting/boxSlicer.py
===================================================================
--- guiframe/local_perspectives/plotting/boxSlicer.py	(revision eba08f1a43992e4ce1b52d3a3dd206926fdeb56a)
+++ guiframe/local_perspectives/plotting/boxSlicer.py	(revision 6c0568bd80268d53159740762af718581163832a)
@@ -25,21 +25,20 @@
     def __init__(self,base,axes,color='black', zorder=3):
         _BaseInteractor.__init__(self, base, axes, color=color)
-        
+        ## Class initialization
         self.markers = []
         self.axes = axes
-        
+        ##connecting artist
         self.connect = self.base.connect
-        
+        ## determine x y  values
         self.x= 0.5*min(math.fabs(self.base.data2D.xmax),math.fabs( self.base.data2D.xmin))
         self.y= 0.5*min(math.fabs(self.base.data2D.xmax),math.fabs( self.base.data2D.xmin))        
-        
+        ## when reach qmax reset the graph
         self.qmax = max(self.base.data2D.xmax,self.base.data2D.xmin,
                         self.base.data2D.ymax,self.base.data2D.ymin )   
-        
         ## Number of points on the plot
         self.nbins = 30
-       
+        ## reference of the current  Slab averaging
         self.averager=None
-        
+        ## Create vertical and horizaontal lines for the rectangle
         self.vertical_lines = VerticalLines(self, self.base.subplot,color='blue', 
                                       zorder=zorder,
@@ -53,13 +52,18 @@
                                       y= self.y)
         self.horizontal_lines.qmax= self.qmax
-        
+        ## draw the rectangle and plost the data 1D resulting
+        ## of averaging data2D
         self.update()
         self._post_data()
-        
-        # Bind to slice parameter events
+        ## Bind to slice parameter events
         self.base.Bind(EVT_SLICER_PARS, self._onEVT_SLICER_PARS)
 
 
     def _onEVT_SLICER_PARS(self, event):
+        """
+            receive an event containing parameters values to reset the slicer
+            @param event: event of type SlicerParameterEvent with params as 
+            attribute
+        """
         wx.PostEvent(self.base.parent, StatusEvent(status="BoxSlicer._onEVT_SLICER_PARS"))
         event.Skip()
@@ -68,23 +72,26 @@
             self.base.update()
 
+
     def update_and_post(self):
+        """
+            Update the slicer and plot the resulting data
+        """
         self.update()
         self._post_data()
 
-    def save_data(self, path, image, x, y):
-        output = open(path, 'w')
-        
-        data_x, data_y = self.get_data(image, x, y)
-        
-        output.write("<phi>  <average>\n")
-        for i in range(len(data_x)):
-            output.write("%g  %g\n" % (data_x[i], data_y[i]))
-        output.close()
 
     def set_layer(self, n):
+        """
+             Allow adding plot to the same panel
+             @param n: the number of layer
+        """
         self.layernum = n
         self.update()
         
+        
     def clear(self):
+        """
+            Clear the slicer and all connected events related to this slicer
+        """
         self.averager=None
         self.clear_markers()
@@ -92,6 +99,6 @@
         self.vertical_lines.clear()
         self.base.connect.clearall()
-        
         self.base.Unbind(EVT_SLICER_PARS)
+        
         
     def update(self):
@@ -100,13 +107,13 @@
         resetting the widgets.
         """
+        ##Update the slicer if an horizontal line is dragged   
         if self.horizontal_lines.has_move:
-            #print "top has moved"
             self.horizontal_lines.update()
             self.vertical_lines.update(y=self.horizontal_lines.y)
+        
+        ##Update the slicer if a vertical line is dragged    
         if self.vertical_lines.has_move:
-            #print "right has moved"
             self.vertical_lines.update()
             self.horizontal_lines.update(x=self.vertical_lines.x)
-            
                
             
@@ -125,5 +132,9 @@
     
     def post_data(self,new_slab=None , nbins=None):
-        """ post data averaging in Q"""
+        """
+             post data averaging in Qx or Qy given new_slab type
+             @param new_slab: slicer that determine with direction to average
+             @param nbins: the number of points plotted when averaging
+        """
         x_min= -1*math.fabs(self.vertical_lines.x)
         x_max= math.fabs(self.vertical_lines.x)
@@ -139,10 +150,10 @@
             self.averager= new_slab
         bin_width= (x_max + math.fabs(x_min))/self.nbins
-        
+        ## Average data2D given Qx or Qy
         box = self.averager( x_min=x_min, x_max=x_max, y_min=y_min, y_max=y_max,
                          bin_width=bin_width)
         
         boxavg = box(self.base.data2D)
-        
+        #3 Create Data1D to plot
         from sans.guiframe.dataFitting import Data1D
         if hasattr(boxavg,"dxl"):
@@ -158,9 +169,6 @@
         new_plot.name = str(self.averager.__name__) +"("+ self.base.data2D.name+")"
         
-       
-
         new_plot.source=self.base.data2D.source
         new_plot.interactive = True
-        #print "loader output.detector",output.source
         new_plot.detector =self.base.data2D.detector
         # If the data file does not tell us what the axes are, just assume...
@@ -175,6 +183,10 @@
                                        
     def moveend(self, ev):
+        """
+            Called after a dragging event.
+            Post the slicer new parameters and creates a new Data1D 
+            corresponding to the new average
+        """
         self.base.thaw_axes()
-        
         # Post paramters
         event = SlicerParameterEvent()
@@ -182,6 +194,7 @@
         event.params = self.get_params()
         wx.PostEvent(self.base.parent, event)
-
+        # create the new data1D
         self._post_data()
+            
             
     def restore(self):
@@ -199,17 +212,27 @@
         pass
         
+        
     def set_cursor(self, x, y):
         pass
         
+        
     def get_params(self):
+        """
+            Store a copy of values of parameters of the slicer into a dictionary.
+            @return params: the dictionary created
+        """
         params = {}
         params["x_max"]= math.fabs(self.vertical_lines.x)
         params["y_max"]= math.fabs(self.horizontal_lines.y)
         params["nbins"]= self.nbins
-      
         return params
     
     def set_params(self, params):
-        
+        """
+            Receive a dictionary and reset the slicer with values contained 
+            in the values of the dictionary.
+            @param params: a dictionary containing name of slicer parameters and 
+            values the user assigned to the slicer.
+        """
         self.x = float(math.fabs(params["x_max"]))
         self.y = float(math.fabs(params["y_max"] ))
@@ -224,19 +247,25 @@
         self.base.freeze_axes()
         
+        
     def thaw_axes(self):
         self.base.thaw_axes()
 
+
     def draw(self):
         self.base.draw()
 
+
 class HorizontalLines(_BaseInteractor):
     """
-         Select an annulus through a 2D plot
+         Draw 2 Horizontal lines centered on (0,0) that can move 
+         on the x- direction and in opposite direction
     """
     def __init__(self,base,axes,color='black', zorder=5,x=0.5, y=0.5):
         
         _BaseInteractor.__init__(self, base, axes, color=color)
+        ##Class initialization
         self.markers = []
         self.axes = axes
+        ## Saving the end points of two lines
         self.x= x
         self.save_x= x
@@ -244,5 +273,5 @@
         self.y= y
         self.save_y= y
-       
+        ## Creating a marker
         try:
             # Inner circle marker
@@ -261,5 +290,8 @@
             message  = "\nTHIS PROTOTYPE NEEDS THE LATEST VERSION OF MATPLOTLIB\n"
             message += "Get the SVN version that is at least as recent as June 1, 2007"
-            
+            owner=self.base.base.parent
+            wx.PostEvent(owner, StatusEvent(status="AnnulusSlicer: %s"%message))
+            
+        ## Define 2 horizontal lines
         self.top_line = self.axes.plot([self.x,-self.x],
                                    [self.y,self.y],
@@ -272,14 +304,24 @@
                                       color=self.color,
                                       visible=True)[0]
-        
+        ## Flag to check the motion of the lines
         self.has_move=False
+        ## Connecting markers to mouse events and draw
         self.connect_markers([self.top_line, self.inner_marker])
         self.update()
 
+
     def set_layer(self, n):
+        """
+            Allow adding plot to the same panel
+            @param n: the number of layer
+        """
         self.layernum = n
         self.update()
         
+        
     def clear(self):
+        """
+            Clear this slicer  and its markers
+        """
         self.clear_markers()
         try:
@@ -295,12 +337,15 @@
     def update(self,x=None,y=None):
         """
-        Draw the new roughness on the graph.
-        """
+            Draw the new roughness on the graph.
+            @param x: x-coordinates to reset current class x
+            @param y: y-coordinates to reset current class y
+        """
+        ## Reset x, y- coordinates if send as parameters
         if x!=None:
             self.x = numpy.sign(self.x)*math.fabs(x)
         if y !=None:
             self.y = numpy.sign(self.y)*math.fabs(y)
+        ## Draw lines and markers
         self.inner_marker.set(xdata=[0],ydata=[self.y])
-        
         self.top_line.set(xdata=[self.x,-self.x],
                        ydata=[self.y,self.y])
@@ -316,11 +361,15 @@
         self.save_x= self.x
         self.save_y= self.y
-        
         self.base.freeze_axes()
 
+
     def moveend(self, ev):
-       
+        """
+            Called after a dragging this edge and set self.has_move to False
+            to specify the end of dragging motion
+        """
         self.has_move=False
         self.base.moveend(ev)
+           
             
     def restore(self):
@@ -336,5 +385,4 @@
         Process move to a new position, making sure that the move is allowed.
         """
-        #print "horizontal move x y "
         self.y= y
         self.has_move=True
@@ -342,7 +390,4 @@
         
   
-        
-  
-    
 class VerticalLines(_BaseInteractor):
     """
@@ -390,9 +435,18 @@
         self.update()
 
+
     def set_layer(self, n):
+        """
+            Allow adding plot to the same panel
+            @param n: the number of layer
+        """
         self.layernum = n
         self.update()
         
+        
     def clear(self):
+        """
+            Clear this slicer  and its markers
+        """
         self.clear_markers()
         try:
@@ -405,14 +459,17 @@
                 del self.axes.lines[0]
 
+
     def update(self,x=None,y=None):
         """
-        Draw the new roughness on the graph.
-        """
-
+            Draw the new roughness on the graph.
+            @param x: x-coordinates to reset current class x
+            @param y: y-coordinates to reset current class y
+        """
+        ## reset x, y -coordinates if given as parameters
         if x!=None:
             self.x = numpy.sign(self.x)*math.fabs(x)
         if y !=None:
             self.y = numpy.sign(self.y)*math.fabs(y)
-            
+        ## draw lines and markers  
         self.inner_marker.set(xdata=[self.x],ydata=[0]) 
         self.left_line.set(xdata=[-self.x,-self.x],
@@ -432,8 +489,13 @@
         self.base.freeze_axes()
 
+
     def moveend(self, ev):
-        
+        """
+            Called after a dragging this edge and set self.has_move to False
+            to specify the end of dragging motion
+        """
         self.has_move=False
         self.base.moveend(ev)
+            
             
     def restore(self):
@@ -464,5 +526,10 @@
         self.base=base
         self._post_data()
+        
+        
     def _post_data(self):
+        """
+             Post data creating by averaging in Qx direction
+        """
         from DataLoader.manipulations import SlabX
         self.post_data(SlabX )   
@@ -477,5 +544,10 @@
         self.base=base
         self._post_data()
+        
+        
     def _post_data(self):
+        """
+             Post data creating by averaging in Qy direction
+        """
         from DataLoader.manipulations import SlabY
         self.post_data(SlabY )   
Index: guiframe/local_perspectives/plotting/boxSum.py
===================================================================
--- guiframe/local_perspectives/plotting/boxSum.py	(revision eba08f1a43992e4ce1b52d3a3dd206926fdeb56a)
+++ guiframe/local_perspectives/plotting/boxSum.py	(revision 6c0568bd80268d53159740762af718581163832a)
@@ -497,5 +497,5 @@
     def clear(self):
         """
-            Clear this figure and its markers
+            Clear this slicer  and its markers
         """
         self.clear_markers()
Index: guiframe/local_perspectives/plotting/plotting.py
===================================================================
--- guiframe/local_perspectives/plotting/plotting.py	(revision 6d920cd2a2b96abc4845a5766911d8ef7fe5adc5)
+++ guiframe/local_perspectives/plotting/plotting.py	(revision 6c0568bd80268d53159740762af718581163832a)
@@ -12,7 +12,4 @@
 import wx
 import sys
-#import danse.common.plottools
-#from danse.common.plottools.PlotPanel import PlotPanel
-#from danse.common.plottools.plottables import Graph,Data1D
 from sans.guicomm.events import EVT_NEW_PLOT
 from sans.guicomm.events import StatusEvent 
@@ -86,7 +83,10 @@
         pass
     
+    
     def _on_show_panel(self, event):
-        print "_on_show_panel"
-   
+        """show plug-in panel"""
+        pass
+    
+    
     def _on_plot_event(self, event):
         """
@@ -104,4 +104,5 @@
             and event.plot._yunit == panel.graph.prop["yunit_base"]:
                 if hasattr(event.plot, "group_id"):
+                    ## if same group_id used the same panel to plot
                     if not event.plot.group_id==None \
                         and event.plot.group_id==panel.group_id:
@@ -109,9 +110,8 @@
                         
                         panel._onEVT_1DREPLOT(event)
-                        self.parent.show_panel(panel.uid)
-                        #print "went here for replottiing", event.plot.name
-                        
+                        self.parent.show_panel(panel.uid)   
                 else:
                     # Check that the plot panel has no group ID
+                    ## Use a panel with group_id ==None to plot
                     if panel.group_id==None:
                         is_available = True
@@ -123,20 +123,25 @@
             if not hasattr(event.plot,'data'):
                 from Plotter1D import ModelPanel1D
+                ## get the data representation label of the data to plot
+                ## when even the user select "change scale"
                 if hasattr(event.plot,"xtransform"):
-                    #print "went here"
                     xtransform = event.plot.xtransform
                 else:
-                   
                     xtransform =None
+                    
                 if hasattr(event.plot,"ytransform"):
                     ytransform=  event.plot.ytransform
                 else:
                     ytransform=None
+                ## create a plotpanel for 1D Data
                 new_panel = ModelPanel1D(self.parent, -1,xtransform=xtransform,
                                          ytransform=ytransform, style=wx.RAISED_BORDER)
             else:
+                ##Create a new plotpanel for 2D data
                 from Plotter2D import ModelPanel2D
                 new_panel = ModelPanel2D(self.parent, -1, data2d=event.plot,style=wx.RAISED_BORDER)
-            # Set group ID if available
+            
+            ## Set group ID if available
+            ## Assign data properties to the new create panel
             group_id_str = ''
             if hasattr(event.plot, "group_id"):
@@ -148,7 +153,5 @@
                 new_panel.window_caption = event.title
                 new_panel.window_name = event.title
-                #new_panel.window_caption = event.title+group_id_str
-                #new_panel.window_name = event.title+group_id_str
-            
+               
             event_id = self.parent.popup_panel(new_panel)
             self.menu.Append(event_id, new_panel.window_caption, 
