Index: src/sas/guiframe/local_perspectives/plotting/boxSlicer.py
===================================================================
--- src/sas/guiframe/local_perspectives/plotting/boxSlicer.py	(revision 794922220f2fb3b23dd08c648aabf87b4850596c)
+++ src/sas/guiframe/local_perspectives/plotting/boxSlicer.py	(revision b5de88e13816ca80c8329096bc22edbab9a36123)
@@ -1,7 +1,3 @@
-
-
 import wx
-#import copy
-#from copy import deepcopy
 import math
 import numpy
@@ -12,5 +8,4 @@
 from BaseInteractor import _BaseInteractor
 from sas.guiframe.dataFitting import Data1D
-#import SlicerParameters
 
 
@@ -22,47 +17,47 @@
     def __init__(self, base, axes, color='black', zorder=3):
         _BaseInteractor.__init__(self, base, axes, color=color)
-        ## Class initialization
+        # # Class initialization
         self.markers = []
         self.axes = axes
-        ##connecting artist
+        # #connecting artist
         self.connect = self.base.connect
-        ## which direction is the preferred interaction direction
+        # # which direction is the preferred interaction direction
         self.direction = None
-        ## determine x y  values
+        # # 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
+                           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.base.data2D.ymax, self.base.data2D.ymin)
+        # # Number of points on the plot
         self.nbins = 30
-        ## If True, I(|Q|) will be return, otherwise,
-        #negative q-values are allowed
-        self.fold = True        
-        ## reference of the current  Slab averaging
+        # # If True, I(|Q|) will be return, otherwise,
+        # negative q-values are allowed
+        self.fold = True
+        # # reference of the current  Slab averaging
         self.averager = None
-        ## Create vertical and horizaontal lines for the rectangle
+        # # Create vertical and horizaontal lines for the rectangle
         self.vertical_lines = VerticalLines(self,
-                                            self.base.subplot, 
-                                            color='blue', 
+                                            self.base.subplot,
+                                            color='blue',
                                             zorder=zorder,
-                                            y=self.y ,
+                                            y=self.y,
                                             x=self.x)
         self.vertical_lines.qmax = self.qmax
-       
+
         self.horizontal_lines = HorizontalLines(self,
-                                               self.base.subplot,
-                                               color='green', 
-                                               zorder=zorder,
-                                               x=self.x,
-                                               y=self.y)
+                                                self.base.subplot,
+                                                color='green',
+                                                zorder=zorder,
+                                                x=self.x,
+                                                y=self.y)
         self.horizontal_lines.qmax = self.qmax
-        ## draw the rectangle and plost the data 1D resulting
-        ## of averaging data2D
+        # # 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)
 
@@ -70,6 +65,6 @@
         """
         receive an event containing parameters values to reset the slicer
-        
-        :param event: event of type SlicerParameterEvent with params as 
+
+        :param event: event of type SlicerParameterEvent with params as
             attribute
         """
@@ -80,5 +75,5 @@
             self.set_params(event.params)
             self.base.update()
-            
+
     def update_and_post(self):
         """
@@ -87,15 +82,15 @@
         self.update()
         self._post_data()
-        
+
     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):
         """
@@ -108,5 +103,5 @@
         self.base.connect.clearall()
         self.base.Unbind(EVT_SLICER_PARS)
-        
+
     def update(self):
         """
@@ -114,13 +109,13 @@
         resetting the widgets.
         """
-        ##Update the slicer if an horizontal line is dragged   
+        # #Update the slicer if an horizontal line is dragged
         if self.horizontal_lines.has_move:
             self.horizontal_lines.update()
             self.vertical_lines.update(y=self.horizontal_lines.y)
-        ##Update the slicer if a vertical line is dragged    
+        # #Update the slicer if a vertical line is dragged
         if self.vertical_lines.has_move:
             self.vertical_lines.update()
             self.horizontal_lines.update(x=self.vertical_lines.x)
-                 
+
     def save(self, ev):
         """
@@ -131,25 +126,25 @@
         self.vertical_lines.save(ev)
         self.horizontal_lines.save(ev)
-    
+
     def _post_data(self):
         pass
-        
+
     def post_data(self, new_slab=None, nbins=None, direction=None):
         """
         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
         :param direction: the direction of averaging
-        
+
         """
         if self.direction == None:
             self.direction = direction
-            
+
         x_min = -1 * math.fabs(self.vertical_lines.x)
         x_max = math.fabs(self.vertical_lines.x)
         y_min = -1 * math.fabs(self.horizontal_lines.y)
         y_max = math.fabs(self.horizontal_lines.y)
-        
+
         if nbins != None:
             self.nbins = nbins
@@ -164,5 +159,5 @@
             else:
                 x_low = math.fabs(x_min)
-            bin_width = (x_max + x_low)/self.nbins
+            bin_width = (x_max + x_low) / self.nbins
         elif self.direction == "Y":
             if self.fold:
@@ -170,14 +165,14 @@
             else:
                 y_low = math.fabs(y_min)
-            bin_width = (y_max + y_low)/self.nbins
+            bin_width = (y_max + y_low) / self.nbins
         else:
             msg = "post data:no Box Average direction was supplied"
             raise ValueError, msg
-        ## Average data2D given Qx or Qy
+        # # 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)
+                            bin_width=bin_width)
         box.fold = self.fold
         boxavg = box(self.base.data2D)
-        #3 Create Data1D to plot
+        # 3 Create Data1D to plot
         if hasattr(boxavg, "dxl"):
             dxl = boxavg.dxl
@@ -189,6 +184,6 @@
             dxw = None
         new_plot = Data1D(x=boxavg.x, y=boxavg.y, dy=boxavg.dy)
-        new_plot.dxl  = dxl
-        new_plot.dxw  = dxw
+        new_plot.dxl = dxl
+        new_plot.dxw = dxw
         new_plot.name = str(self.averager.__name__) + \
                         "(" + self.base.data2D.name + ")"
@@ -196,5 +191,5 @@
         new_plot.interactive = True
         new_plot.detector = self.base.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}")
@@ -205,17 +200,17 @@
             new_plot.ytransform = 'y'
             new_plot.yaxis("\\rm{Residuals} ", "/")
-            
+
         new_plot.group_id = "2daverage" + self.base.data2D.name
         new_plot.id = (self.averager.__name__) + self.base.data2D.name
-        new_plot.is_data= True
+        new_plot.is_data = True
         self.base.parent.update_theory(data_id=self.base.data2D.id, \
                                        theory=new_plot)
-        wx.PostEvent(self.base.parent, NewPlotEvent(plot=new_plot,
-                                title=str(self.averager.__name__)))
-          
+        wx.PostEvent(self.base.parent,
+                     NewPlotEvent(plot=new_plot, title=str(self.averager.__name__)))
+
     def moveend(self, ev):
         """
         Called after a dragging event.
-        Post the slicer new parameters and creates a new Data1D 
+        Post the slicer new parameters and creates a new Data1D
         corresponding to the new average
         """
@@ -228,5 +223,5 @@
         # create the new data1D
         self._post_data()
-            
+
     def restore(self):
         """
@@ -235,5 +230,5 @@
         self.horizontal_lines.restore()
         self.vertical_lines.restore()
-       
+
     def move(self, x, y, ev):
         """
@@ -241,14 +236,14 @@
         """
         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 = {}
@@ -257,26 +252,26 @@
         params["nbins"] = self.nbins
         return params
-    
+
     def set_params(self, params):
         """
-        Receive a dictionary and reset the slicer with values contained 
+        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 
+
+        :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"] ))
+        self.y = float(math.fabs(params["y_max"]))
         self.nbins = params["nbins"]
-        
+
         self.horizontal_lines.update(x=self.x, y=self.y)
         self.vertical_lines.update(x=self.x, y=self.y)
         self.post_data(nbins=None)
-        
+
     def freeze_axes(self):
         """
         """
         self.base.freeze_axes()
-        
+
     def thaw_axes(self):
         """
@@ -292,5 +287,5 @@
 class HorizontalLines(_BaseInteractor):
     """
-    Draw 2 Horizontal lines centered on (0,0) that can move 
+    Draw 2 Horizontal lines centered on (0,0) that can move
     on the x- direction and in opposite direction
     """
@@ -299,44 +294,31 @@
         """
         _BaseInteractor.__init__(self, base, axes, color=color)
-        ##Class initialization
+        # #Class initialization
         self.markers = []
         self.axes = axes
-        ## Saving the end points of two lines
+        # # Saving the end points of two lines
         self.x = x
         self.save_x = x
-        
+
         self.y = y
         self.save_y = y
-        ## Creating a marker
-        try:
-            # Inner circle marker
-            self.inner_marker = self.axes.plot([0], [self.y], linestyle='',
-                                          marker='s', markersize=10,
-                                          color=self.color, alpha=0.6,
-                                          pickradius=5, label="pick", 
-                                          # Prefer this to other lines
-                                          zorder=zorder, 
-                                          visible=True)[0]
-        except:
-            self.inner_marker = self.axes.plot([0], [self.y], linestyle='',
-                                          marker='s', markersize=10,
-                                          color=self.color, alpha=0.6,
-                                          label="pick", visible=True)[0]
-            message  = "\nTHIS PROTOTYPE NEEDS THE LATEST VERSION "
-            message += "OF MATPLOTLIB\n Get the SVN version that"
-            message += " 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
+        # # Creating a marker
+        # Inner circle marker
+        self.inner_marker = self.axes.plot([0], [self.y], linestyle='',
+                                           marker='s', markersize=10,
+                                           color=self.color, alpha=0.6,
+                                           pickradius=5, label="pick",
+                                           zorder=zorder,
+                                           visible=True)[0]
+        # # Define 2 horizontal lines
         self.top_line = self.axes.plot([self.x, -self.x], [self.y, self.y],
-                                      linestyle='-', marker='',
-                                      color=self.color, visible=True)[0]
+                                       linestyle='-', marker='',
+                                       color=self.color, visible=True)[0]
         self.bottom_line = self.axes.plot([self.x, -self.x], [-self.y, -self.y],
-                                      linestyle='-', marker='',
-                                      color=self.color, visible=True)[0]
-        ## Flag to check the motion of the lines
+                                          linestyle='-', marker='',
+                                          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
+        # # Connecting markers to mouse events and draw
         self.connect_markers([self.top_line, self.inner_marker])
         self.update()
@@ -345,11 +327,11 @@
         """
         Allow adding plot to the same panel
-        
+
         :param n: the number of layer
-        
+
         """
         self.layernum = n
         self.update()
-        
+
     def clear(self):
         """
@@ -359,5 +341,5 @@
         try:
             self.inner_marker.remove()
-            self.top_line.remove() 
+            self.top_line.remove()
             self.bottom_line.remove()
         except:
@@ -365,23 +347,23 @@
             for item in range(len(self.axes.lines)):
                 del self.axes.lines[0]
-   
+
     def update(self, x=None, y=None):
         """
         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
+
+        """
+        # # 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
+        # # 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])
-        self.bottom_line.set(xdata=[self.x,-self.x], ydata=[-self.y, -self.y])
-        
+        self.bottom_line.set(xdata=[self.x, -self.x], ydata=[-self.y, -self.y])
+
     def save(self, ev):
         """
@@ -400,5 +382,5 @@
         self.has_move = False
         self.base.moveend(ev)
-             
+
     def restore(self):
         """
@@ -407,5 +389,5 @@
         self.x = self.save_x
         self.y = self.save_y
-        
+
     def move(self, x, y, ev):
         """
@@ -415,6 +397,6 @@
         self.has_move = True
         self.base.base.update()
-        
-  
+
+
 class VerticalLines(_BaseInteractor):
     """
@@ -431,29 +413,18 @@
         self.y = math.fabs(y)
         self.save_y = y
-        try:
-            # Inner circle marker
-            self.inner_marker = self.axes.plot([self.x], [0], linestyle='',
-                                          marker='s', markersize=10,
-                                          color=self.color, alpha=0.6,
-                                          pickradius=5, label="pick", 
-                                          # Prefer this to other lines
-                                          zorder=zorder, visible=True)[0]
-        except:
-            self.inner_marker = self.axes.plot([self.x], [0], linestyle='',
-                                          marker='s', markersize=10,
-                                          color=self.color, alpha=0.6,
-                                          label="pick", visible=True)[0]
-            message  = "\nTHIS PROTOTYPE NEEDS THE LATEST VERSION"
-            message += " OF MATPLOTLIB\n Get the SVN version that is"
-            message += " at least as recent as June 1, 2007"
-            
+        # Inner circle marker
+        self.inner_marker = self.axes.plot([self.x], [0], linestyle='',
+                                           marker='s', markersize=10,
+                                           color=self.color, alpha=0.6,
+                                           pickradius=5, label="pick",
+                                           zorder=zorder, visible=True)[0]
         self.right_line = self.axes.plot([self.x, self.x],
-                                         [self.y , -self.y],
-                                      linestyle='-', marker='',
-                                      color=self.color, visible=True)[0]
+                                         [self.y, -self.y],
+                                         linestyle='-', marker='',
+                                         color=self.color, visible=True)[0]
         self.left_line = self.axes.plot([-self.x, -self.x],
                                         [self.y, -self.y],
-                                      linestyle='-', marker='',
-                                      color=self.color, visible=True)[0]
+                                        linestyle='-', marker='',
+                                        color=self.color, visible=True)[0]
         self.has_move = False
         self.connect_markers([self.right_line, self.inner_marker])
@@ -463,11 +434,11 @@
         """
         Allow adding plot to the same panel
-        
+
         :param n: the number of layer
-        
+
         """
         self.layernum = n
         self.update()
-        
+
     def clear(self):
         """
@@ -487,19 +458,19 @@
         """
         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
+
+        """
+        # # 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], ydata=[self.y, -self.y]) 
-        self.right_line.set(xdata=[self.x, self.x], ydata=[self.y, -self.y]) 
-    
+        # # draw lines and markers
+        self.inner_marker.set(xdata=[self.x], ydata=[0])
+        self.left_line.set(xdata=[-self.x, -self.x], ydata=[self.y, -self.y])
+        self.right_line.set(xdata=[self.x, self.x], ydata=[self.y, -self.y])
+
     def save(self, ev):
         """
@@ -510,5 +481,5 @@
         self.save_y = self.y
         self.base.freeze_axes()
-        
+
     def moveend(self, ev):
         """
@@ -518,5 +489,5 @@
         self.has_move = False
         self.base.moveend(ev)
-               
+
     def restore(self):
         """
@@ -525,5 +496,5 @@
         self.x = self.save_x
         self.y = self.save_y
-      
+
     def move(self, x, y, ev):
         """
@@ -533,6 +504,6 @@
         self.x = x
         self.base.base.update()
-        
-   
+
+
 class BoxInteractorX(BoxInteractor):
     """
@@ -543,5 +514,5 @@
         self.base = base
         self._post_data()
-        
+
     def _post_data(self):
         """
@@ -549,6 +520,6 @@
         """
         from sas.dataloader.manipulations import SlabX
-        self.post_data(SlabX, direction="X")   
-        
+        self.post_data(SlabX, direction="X")
+
 
 class BoxInteractorY(BoxInteractor):
@@ -560,5 +531,5 @@
         self.base = base
         self._post_data()
-        
+
     def _post_data(self):
         """
@@ -566,5 +537,4 @@
         """
         from sas.dataloader.manipulations import SlabY
-        self.post_data(SlabY, direction="Y")   
-        
-        
+        self.post_data(SlabY, direction="Y")
+
