Index: src/sas/perspectives/invariant/invariant_details.py
===================================================================
--- src/sas/perspectives/invariant/invariant_details.py	(revision 794922220f2fb3b23dd08c648aabf87b4850596c)
+++ src/sas/perspectives/invariant/invariant_details.py	(revision 78a205ad60ae50caaa91008f0d11b7bb5353d84d)
@@ -8,13 +8,13 @@
 from invariant_widgets import OutputTextCtrl
 # Dimensions related to chart
-RECTANGLE_WIDTH  = 400.0  
+RECTANGLE_WIDTH = 400.0
 RECTANGLE_HEIGHT = 20
-#Invariant panel size 
+# Invariant panel size
 _BOX_WIDTH = 76
 
-#scale to use for a bar of value zero
-RECTANGLE_SCALE  = 0.0001
-DEFAULT_QSTAR = 1.0  
-  
+# scale to use for a bar of value zero
+RECTANGLE_SCALE = 0.0001
+DEFAULT_QSTAR = 1.0
+
 if sys.platform.count("win32") > 0:
     _STATICBOX_WIDTH = 450
@@ -27,34 +27,34 @@
     PANEL_HEIGHT = 430
     FONT_VARIANT = 1
-    
-ERROR_COLOR = wx.Colour(255,  0, 0, 128)
-EXTRAPOLATION_COLOR = wx.Colour(169,  169, 168, 128)
-INVARIANT_COLOR =  wx.Colour(67,  208,  128, 128)    
-  
-  
+
+ERROR_COLOR = wx.Colour(255, 0, 0, 128)
+EXTRAPOLATION_COLOR = wx.Colour(169, 169, 168, 128)
+INVARIANT_COLOR = wx.Colour(67, 208, 128, 128)
+
+
 class InvariantContainer(wx.Object):
     """
     This class stores some values resulting resulting from invariant
-    calculations. Given the value of total invariant, this class can also 
+    calculations. Given the value of total invariant, this class can also
     determine the percentage of invariants resulting from extrapolation.
     """
     def __init__(self):
-        #invariant at low range
+        # invariant at low range
         self.qstar_low = None
-        #invariant at low range error
+        # invariant at low range error
         self.qstar_low_err = None
-        #invariant 
+        # invariant
         self.qstar = None
-        #invariant error
+        # invariant error
         self.qstar_err = None
-        #invariant at high range
+        # invariant at high range
         self.qstar_high = None
-        #invariant at high range error
+        # invariant at high range error
         self.qstar_high_err = None
-        #invariant total
+        # invariant total
         self.qstar_total = None
-        #invariant error
+        # invariant error
         self.qstar_total_err = None
-        #scale
+        # scale
         self.qstar_low_percent = None
         self.qstar_high_percent = None
@@ -63,5 +63,5 @@
         self.existing_warning = False
         self.warning_msg = "No Details on calculations available...\n"
-        
+
     def compute_percentage(self):
         """
@@ -73,15 +73,15 @@
             self.qstar_high = None
             self.check_values()
-            return 
-        
-        #compute invariant percentage
+            return
+
+        # compute invariant percentage
         if self.qstar is None:
             self.qstar_percent = None
         else:
             try:
-                self.qstar_percent = float(self.qstar)/float(self.qstar_total)
+                self.qstar_percent = float(self.qstar) / float(self.qstar_total)
             except:
                 self.qstar_percent = 'error'
-        #compute low q invariant percentage
+        # compute low q invariant percentage
         if self.qstar_low is None:
             self.qstar_low_percent = None
@@ -89,8 +89,8 @@
             try:
                 self.qstar_low_percent = float(self.qstar_low)\
-                                            /float(self.qstar_total)
+                                            / float(self.qstar_total)
             except:
                 self.qstar_low_percent = 'error'
-        #compute high q invariant percentage
+        # compute high q invariant percentage
         if self.qstar_high is None:
             self.qstar_high_percent = None
@@ -98,9 +98,9 @@
             try:
                 self.qstar_high_percent = float(self.qstar_high)\
-                                                /float(self.qstar_total)
+                                                / float(self.qstar_total)
             except:
                 self.qstar_high_percent = 'error'
         wx.CallAfter(self.check_values)
-   
+
     def check_values(self):
         """
@@ -109,5 +109,5 @@
         if self.qstar_total is None and self.qstar is None:
             self.warning_msg = "Invariant not calculated.\n"
-            return 
+            return
         if self.qstar_total == 0:
             self.existing_warning = True
@@ -115,6 +115,6 @@
             self.warning_msg += "The calculations are likely "
             self.warning_msg += "to be unreliable!\n"
-            return 
-        #warning to the user when the extrapolated invariant is greater than %5
+            return
+        # warning to the user when the extrapolated invariant is greater than %5
         msg = ''
         if self.qstar_percent == 'error':
@@ -135,5 +135,5 @@
                 msg += "Error occurred when computing extrapolated invariant"
                 msg += " at low-Q region.\n"
-        elif self.qstar_low_percent is not None :
+        elif self.qstar_low_percent is not None:
             if self.qstar_low_percent >= 0.05:
                 self.existing_warning = True
@@ -172,76 +172,75 @@
             msg += "The sum of all extrapolated contributions is higher "
             msg += "than 5% of the invariant.\n"
-            
+
         if self.existing_warning:
             self.warning_msg = ''
-            self.warning_msg += msg 
+            self.warning_msg += msg
             self.warning_msg += "The calculations are likely to be"
             self.warning_msg += " unreliable!\n"
         else:
             self.warning_msg = "No Details on calculations available...\n"
-            
+
 class InvariantDetailsPanel(wx.Dialog):
     """
-    This panel describes proportion of invariants 
+    This panel describes proportion of invariants
     """
-    def __init__(self, parent=None, id=-1, qstar_container=None, 
-                                    title="Invariant Details",
-                                    size=(PANEL_WIDTH, PANEL_HEIGHT)):
+    def __init__(self, parent=None, id=-1, qstar_container=None,
+                 title="Invariant Details",
+                 size=(PANEL_WIDTH, PANEL_HEIGHT)):
         wx.Dialog.__init__(self, parent=parent, id=id, title=title, size=size)
-        
-        #Font size 
+
+        # Font size
         self.SetWindowVariant(variant=FONT_VARIANT)
         self.parent = parent
-        #self.qstar_container
+        # self.qstar_container
         self.qstar_container = qstar_container
-        #warning message
+        # warning message
         self.warning_msg = self.qstar_container.warning_msg
-   
-        #Define scale of each bar
+
+        # Define scale of each bar
         self.low_inv_percent = self.qstar_container.qstar_low_percent
         self.low_scale = self.get_scale(percentage=self.low_inv_percent,
-                                         scale_name="Extrapolated at Low Q")
+                                        scale_name="Extrapolated at Low Q")
         self.inv_percent = self.qstar_container.qstar_percent
-        self.inv_scale = self.get_scale(percentage=self.inv_percent, 
-                                            scale_name="Inv in Q range")
+        self.inv_scale = self.get_scale(percentage=self.inv_percent,
+                                        scale_name="Inv in Q range")
         self.high_inv_percent = self.qstar_container.qstar_high_percent
         self.high_scale = self.get_scale(percentage=self.high_inv_percent,
                                          scale_name="Extrapolated at High Q")
-       
-        #Default color the extrapolation bar is grey
+
+        # Default color the extrapolation bar is grey
         self.extrapolation_color_low = EXTRAPOLATION_COLOR
         self.extrapolation_color_high = EXTRAPOLATION_COLOR
         self.invariant_color = INVARIANT_COLOR
-        #change color of high and low bar when necessary
+        # change color of high and low bar when necessary
         self.set_color_bar()
-        #draw the panel itself
+        # draw the panel itself
         self._do_layout()
         self.set_values()
-  
+
     def _define_structure(self):
         """
         Define main sizers needed for this panel
         """
-        #Box sizers must be defined first before defining buttons/textctrls
+        # Box sizers must be defined first before defining buttons/textctrls
         # (MAC).
         self.main_sizer = wx.BoxSizer(wx.VERTICAL)
-        #Sizer related to chart
+        # Sizer related to chart
         chart_box = wx.StaticBox(self, -1, "Invariant Chart")
         self.chart_sizer = wx.StaticBoxSizer(chart_box, wx.VERTICAL)
         self.chart_sizer.SetMinSize((PANEL_WIDTH - 50, 110))
-        #Sizer related to invariant values
-        self.invariant_sizer =  wx.GridBagSizer(4, 4)
+        # Sizer related to invariant values
+        self.invariant_sizer = wx.GridBagSizer(4, 4)
         invariant_box = wx.StaticBox(self, -1, "Numerical Values")
-        self.invariant_box_sizer = wx.StaticBoxSizer(invariant_box,
-                                                      wx.HORIZONTAL)
+        self.invariant_box_sizer = wx.StaticBoxSizer(invariant_box, wx.HORIZONTAL)
 
         self.invariant_box_sizer.SetMinSize((PANEL_WIDTH - 50, -1))
-        #Sizer related to warning message
+        # Sizer related to warning message
         warning_box = wx.StaticBox(self, -1, "Warning")
         self.warning_sizer = wx.StaticBoxSizer(warning_box, wx.VERTICAL)
-        self.warning_sizer.SetMinSize((PANEL_WIDTH-50, -1))
-        #Sizer related to button
+        self.warning_sizer.SetMinSize((PANEL_WIDTH - 50, -1))
+        # Sizer related to button
         self.button_sizer = wx.BoxSizer(wx.HORIZONTAL)
-      
+
     def _layout_shart(self):
         """
@@ -250,13 +249,13 @@
         self.panel_chart = wx.Panel(self)
         self.panel_chart.Bind(wx.EVT_PAINT, self.on_paint)
-        self.chart_sizer.Add(self.panel_chart, 1, wx.EXPAND|wx.ALL, 0)
-        
+        self.chart_sizer.Add(self.panel_chart, 1, wx.EXPAND | wx.ALL, 0)
+
     def _layout_invariant(self):
         """
         Draw widgets related to invariant
         """
-        uncertainty = "+/-" 
+        uncertainty = "+/-"
         unit_invariant = '[1/(cm * A^3)]'
-     
+
         invariant_txt = wx.StaticText(self, -1, 'Q* from Data ')
         invariant_txt.SetToolTipString("Invariant in the data set's Q range.")
@@ -270,5 +269,5 @@
         hint_msg = "Unit of the invariant from data's Q range"
         invariant_units_txt.SetToolTipString(hint_msg)
-       
+
         invariant_low_txt = wx.StaticText(self, -1, 'Q* from Low-Q')
         hint_msg = "Extrapolated invariant from low-Q range."
@@ -284,5 +283,5 @@
         hint_msg = "Unit of the extrapolated invariant from  low-Q range"
         invariant_low_units_txt.SetToolTipString(hint_msg)
-        
+
         invariant_high_txt = wx.StaticText(self, -1, 'Q* from High-Q')
         hint_msg = "Extrapolated invariant from  high-Q range"
@@ -299,81 +298,80 @@
         hint_msg = "Unit of the extrapolated invariant from  high-Q range"
         invariant_high_units_txt.SetToolTipString(hint_msg)
-   
-        #Invariant low
+
+        # Invariant low
         iy = 0
-        ix = 0 
+        ix = 0
         self.invariant_sizer.Add(invariant_low_txt, (iy, ix), (1, 1),
-                             wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
+                                 wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15)
         ix += 1
         self.invariant_sizer.Add(self.invariant_low_tcl, (iy, ix), (1, 1),
-                            wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
-        ix += 1
-        self.invariant_sizer.Add( wx.StaticText(self, -1, uncertainty),
-                         (iy, ix), (1, 1),wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+                                 wx.EXPAND | wx.ADJUST_MINSIZE, 0)
+        ix += 1
+        self.invariant_sizer.Add(wx.StaticText(self, -1, uncertainty),
+                                 (iy, ix), (1, 1), wx.EXPAND | wx.ADJUST_MINSIZE, 0)
         ix += 1
         self.invariant_sizer.Add(self.invariant_low_err_tcl, (iy, ix), (1, 1),
-                            wx.EXPAND|wx.ADJUST_MINSIZE, 0)
-        ix += 1
-        self.invariant_sizer.Add(invariant_low_units_txt
-                         ,(iy, ix), (1, 1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)  
-        #Invariant 
+                                 wx.EXPAND | wx.ADJUST_MINSIZE, 0)
+        ix += 1
+        self.invariant_sizer.Add(invariant_low_units_txt,
+                                 (iy, ix), (1, 1), wx.EXPAND | wx.ADJUST_MINSIZE, 0)
+        # Invariant
         iy += 1
-        ix = 0 
+        ix = 0
         self.invariant_sizer.Add(invariant_txt, (iy, ix), (1, 1),
-                             wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
+                                 wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15)
         ix += 1
         self.invariant_sizer.Add(self.invariant_tcl, (iy, ix), (1, 1),
-                            wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+                                 wx.EXPAND | wx.ADJUST_MINSIZE, 0)
         ix += 1
         self.invariant_sizer.Add(wx.StaticText(self, -1, uncertainty),
-                         (iy, ix), (1, 1),wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+                                 (iy, ix), (1, 1), wx.EXPAND | wx.ADJUST_MINSIZE, 0)
         ix += 1
         self.invariant_sizer.Add(self.invariant_err_tcl, (iy, ix), (1, 1),
-                            wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
-        ix +=1
-        self.invariant_sizer.Add(invariant_units_txt
-                         ,(iy, ix), (1, 1),wx.EXPAND|wx.ADJUST_MINSIZE, 0)  
-        #Invariant high
+                                 wx.EXPAND | wx.ADJUST_MINSIZE, 0)
+        ix += 1
+        self.invariant_sizer.Add(invariant_units_txt,
+                                 (iy, ix), (1, 1), wx.EXPAND | wx.ADJUST_MINSIZE, 0)
+        # Invariant high
         iy += 1
-        ix = 0 
+        ix = 0
         self.invariant_sizer.Add(invariant_high_txt, (iy, ix), (1, 1),
-                             wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
+                                 wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15)
         ix += 1
         self.invariant_sizer.Add(self.invariant_high_tcl, (iy, ix), (1, 1),
-                            wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+                                 wx.EXPAND | wx.ADJUST_MINSIZE, 0)
         ix += 1
         self.invariant_sizer.Add(wx.StaticText(self, -1, uncertainty),
-                         (iy, ix), (1, 1),wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+                                 (iy, ix), (1, 1), wx.EXPAND | wx.ADJUST_MINSIZE, 0)
         ix += 1
         self.invariant_sizer.Add(self.invariant_high_err_tcl, (iy, ix), (1, 1),
-                            wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
-        ix += 1
-        self.invariant_sizer.Add(invariant_high_units_txt
-                         ,(iy, ix), (1, 1),wx.EXPAND|wx.ADJUST_MINSIZE, 0)
-        self.invariant_box_sizer.Add(self.invariant_sizer, 0,
-                                     wx.TOP|wx.BOTTOM, 10)  
-       
+                                 wx.EXPAND | wx.ADJUST_MINSIZE, 0)
+        ix += 1
+        self.invariant_sizer.Add(invariant_high_units_txt,
+                                 (iy, ix), (1, 1), wx.EXPAND | wx.ADJUST_MINSIZE, 0)
+        self.invariant_box_sizer.Add(self.invariant_sizer, 0, wx.TOP | wx.BOTTOM, 10)
+
     def _layout_warning(self):
         """
         Draw widgets related to warning
         """
-        #Warning [string]
-        self.warning_msg_txt = wx.StaticText(self, -1, self.warning_msg)  
+        # Warning [string]
+        self.warning_msg_txt = wx.StaticText(self, -1, self.warning_msg)
         if self.qstar_container.existing_warning:
-            self.warning_msg_txt.SetForegroundColour('red') 
+            self.warning_msg_txt.SetForegroundColour('red')
         self.warning_sizer.AddMany([(self.warning_msg_txt, 0,
-                                     wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 10)])
-        
+                                     wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 10)])
+
     def _layout_button(self):
         """
         Draw widgets related to button
         """
-        #Close button
+        # Close button
         id = wx.NewId()
         button_ok = wx.Button(self, id, "Ok")
         button_ok.SetToolTipString("Give Details on Computation")
         self.Bind(wx.EVT_BUTTON, self.on_close, id=id)
-        self.button_sizer.AddMany([((20, 20), 0 , wx.LEFT, 350),
-                                   (button_ok, 0 , wx.RIGHT, 10)])
+        self.button_sizer.AddMany([((20, 20), 0, wx.LEFT, 350),
+                                   (button_ok, 0, wx.RIGHT, 10)])
     def _do_layout(self):
         """
@@ -386,10 +384,10 @@
         self._layout_button()
         self.main_sizer.AddMany([(self.chart_sizer, 0, wx.ALL, 10),
-                                 ( self.invariant_box_sizer, 0, wx.ALL, 10),
-                                  (self.warning_sizer, 0, wx.ALL, 10),
-                                  (self.button_sizer, 0, wx.ALL, 10)])
+                                 (self.invariant_box_sizer, 0, wx.ALL, 10),
+                                 (self.warning_sizer, 0, wx.ALL, 10),
+                                 (self.button_sizer, 0, wx.ALL, 10)])
         self.SetSizer(self.main_sizer)
-       
-        
+
+
     def set_values(self):
         """
@@ -399,23 +397,23 @@
         self.invariant_tcl.SetValue(value)
         value = format_number(self.qstar_container.qstar_err)
-        self.invariant_err_tcl.SetValue(value) 
+        self.invariant_err_tcl.SetValue(value)
         value = format_number(self.qstar_container.qstar_low)
         self.invariant_low_tcl.SetValue(value)
         value = format_number(self.qstar_container.qstar_low_err)
-        self.invariant_low_err_tcl.SetValue(value) 
+        self.invariant_low_err_tcl.SetValue(value)
         value = format_number(self.qstar_container.qstar_high)
         self.invariant_high_tcl.SetValue(value)
         value = format_number(self.qstar_container.qstar_high_err)
-        self.invariant_high_err_tcl.SetValue(value) 
+        self.invariant_high_err_tcl.SetValue(value)
 
     def get_scale(self, percentage, scale_name='scale'):
         """
-        Check scale receive in this panel. 
+        Check scale receive in this panel.
         """
         scale = RECTANGLE_SCALE
-        try: 
+        try:
             if percentage in [None, 0.0, "error"]:
-                 scale = RECTANGLE_SCALE
-                 return scale
+                scale = RECTANGLE_SCALE
+                return scale
             elif percentage < 0:
                 scale = RECTANGLE_SCALE
@@ -427,5 +425,5 @@
             self.warning_msg += "check this value : %s\n" % str(percentage)
         return  scale
-    
+
     def set_color_bar(self):
         """
@@ -435,12 +433,12 @@
         self.extrapolation_color_high = EXTRAPOLATION_COLOR
         self.invariant_color = INVARIANT_COLOR
-        #warning to the user when the extrapolated invariant is greater than %5
+        # warning to the user when the extrapolated invariant is greater than %5
         if self.low_scale >= 0.05 or self.low_scale > 1 or self.low_scale < 0:
-            self.extrapolation_color_low = ERROR_COLOR 
+            self.extrapolation_color_low = ERROR_COLOR
         if self.high_scale >= 0.05 or self.high_scale > 1 or self.high_scale < 0:
-            self.extrapolation_color_high = ERROR_COLOR 
+            self.extrapolation_color_high = ERROR_COLOR
         if self.inv_scale > 1 or self.inv_scale < 0:
-            self.invariant_color = ERROR_COLOR  
-    
+            self.invariant_color = ERROR_COLOR
+
     def on_close(self, event):
         """
@@ -448,5 +446,5 @@
         """
         self.Close()
-     
+
     def on_paint(self, event):
         """
@@ -461,5 +459,5 @@
             dc.DrawText(msg, 25, 25)
             return
-        #Start the drawing
+        # Start the drawing
         font = wx.SystemSettings.GetFont(wx.SYS_DEFAULT_GUI_FONT)
         font.SetWeight(wx.BOLD)
@@ -467,18 +465,18 @@
         # Draw a rectangle
         path = gc.CreatePath()
-        path.AddRectangle(-RECTANGLE_WIDTH/2,-RECTANGLE_HEIGHT/2,
-                          RECTANGLE_WIDTH/2,RECTANGLE_HEIGHT/2)
+        path.AddRectangle(-RECTANGLE_WIDTH / 2, -RECTANGLE_HEIGHT / 2,
+                          RECTANGLE_WIDTH / 2, RECTANGLE_HEIGHT / 2)
         x_origine = 20
         y_origine = 15
-        #Draw low rectangle
-        gc.PushState()        
+        # Draw low rectangle
+        gc.PushState()
         label = "Q* from Low-Q "
         PathFunc = gc.DrawPath
         w, h = gc.GetTextExtent(label)
         gc.DrawText(label, x_origine, y_origine)
-        #Translate the rectangle
-        x_center = x_origine + RECTANGLE_WIDTH * self.low_scale/2 + w +10
+        # Translate the rectangle
+        x_center = x_origine + RECTANGLE_WIDTH * self.low_scale / 2 + w + 10
         y_center = y_origine + h
-        gc.Translate(x_center, y_center)    
+        gc.Translate(x_center, y_center)
         gc.SetPen(wx.Pen("black", 1))
         gc.SetBrush(wx.Brush(self.extrapolation_color_low))
@@ -488,22 +486,22 @@
             low_percent = 'Error'
         else:
-            low_percent = format_number(self.low_inv_percent*100)+ '%'
+            low_percent = format_number(self.low_inv_percent * 100) + '%'
         x_center = 20
         y_center = -h
         gc.DrawText(low_percent, x_center, y_center)
         # Increase width by self.low_scale
-        gc.Scale(self.low_scale, 1.0) 
+        gc.Scale(self.low_scale, 1.0)
         PathFunc(path)
-        gc.PopState()  
-        #Draw rectangle for invariant   
-        gc.PushState()    # save it again
-        y_origine += 20         
+        gc.PopState()
+        # Draw rectangle for invariant
+        gc.PushState()  # save it again
+        y_origine += 20
         gc.DrawText("Q* from Data ", x_origine, y_origine)
         # offset to the lower part of the window
-        x_center = x_origine + RECTANGLE_WIDTH * self.inv_scale/2 + w + 10
+        x_center = x_origine + RECTANGLE_WIDTH * self.inv_scale / 2 + w + 10
         y_center = y_origine + h
         gc.Translate(x_center, y_center)
         # 128 == half transparent
-        gc.SetBrush(wx.Brush(self.invariant_color)) 
+        gc.SetBrush(wx.Brush(self.invariant_color))
         # Increase width by self.inv_scale
         if self.inv_percent is None:
@@ -512,21 +510,21 @@
             inv_percent = 'Error'
         else:
-            inv_percent = format_number(self.inv_percent*100)+ '%'
-        x_center = 20 
+            inv_percent = format_number(self.inv_percent * 100) + '%'
+        x_center = 20
         y_center = -h
         gc.DrawText(inv_percent, x_center, y_center)
-        gc.Scale(self.inv_scale, 1.0)    
+        gc.Scale(self.inv_scale, 1.0)
         gc.DrawPath(path)
         gc.PopState()
         # restore saved state
-        #Draw rectangle for high invariant
-        gc.PushState() 
-        y_origine += 20 
-        gc.DrawText("Q* from High-Q ", x_origine, y_origine) 
-        #define the position of the new rectangle
-        x_center = x_origine + RECTANGLE_WIDTH * self.high_scale/2 + w + 10
+        # Draw rectangle for high invariant
+        gc.PushState()
+        y_origine += 20
+        gc.DrawText("Q* from High-Q ", x_origine, y_origine)
+        # define the position of the new rectangle
+        x_center = x_origine + RECTANGLE_WIDTH * self.high_scale / 2 + w + 10
         y_center = y_origine + h
         gc.Translate(x_center, y_center)
-        gc.SetBrush(wx.Brush(self.extrapolation_color_high)) 
+        gc.SetBrush(wx.Brush(self.extrapolation_color_high))
         # increase scale by self.high_scale
         if self.high_inv_percent is None:
@@ -535,10 +533,10 @@
             high_percent = 'Error'
         else:
-            high_percent = format_number(self.high_inv_percent*100)+ '%'
+            high_percent = format_number(self.high_inv_percent * 100) + '%'
         x_center = 20
         y_center = -h
         gc.DrawText(high_percent, x_center, y_center)
-       
-        gc.Scale(self.high_scale, 1.0)  
+
+        gc.Scale(self.high_scale, 1.0)
         gc.DrawPath(path)
         gc.PopState()
