Index: guitools/PlotPanel.py
===================================================================
--- guitools/PlotPanel.py	(revision bbec827a62dd9a38aa3499ec4e2d1c2309d427ba)
+++ guitools/PlotPanel.py	(revision ddff053bb27a3db5489cf1f99a890f18c226279e)
@@ -108,6 +108,8 @@
         #self.fit_result = Data1D(x=[], y=[],dx=None, dy=None)
         self.fit_result.name = "Fit"
-        self.fit_result.ID = "isFit"
-
+        self.xmin=0.0
+        self.xmax=0.0
+        self.xminView=0.0
+        self.xmaxView=0.0
     def onWheel(self, event):
         """
@@ -115,5 +117,4 @@
         """
         ax = event.inaxes
-        
         step = event.step
 
@@ -175,4 +176,7 @@
             first_item = list.keys()[0]
             dlg = LinearFit( None, first_item, self.onFitDisplay,self.returnTrans, -1, 'Fitting')
+            if (self.xmin !=0.0 )and ( self.xmax !=0.0)\
+                and(self.xminView !=0.0 )and ( self.xmaxView !=0.0):
+                dlg.setFitRange(self.xminView,self.xmaxView,self.xmin,self.xmax)
             dlg.ShowModal() 
 
@@ -524,5 +528,5 @@
         self.subplot.figure.canvas.draw_idle()
         
-    def onFitDisplay(self, tempx,tempy,xmin,xmax):
+    def onFitDisplay(self, tempx,tempy,xminView,xmaxView,xmin,xmax):
         """
             Add a new plottable into the graph .In this case this plottable will be used 
@@ -535,5 +539,9 @@
         list = self.graph.returnPlottable()
         for item in list:
-            item.onFitRange(xmin,xmax)
+            item.onFitRange(xminView,xmaxView)
+        self.xminView=xminView
+        self.xmaxView=xmaxView
+        self.xmin= xmin
+        self.xmax= xmax
         # Create new data plottable with result
         self.fit_result.x =[] 
Index: guitools/fitDialog.py
===================================================================
--- guitools/fitDialog.py	(revision bbec827a62dd9a38aa3499ec4e2d1c2309d427ba)
+++ guitools/fitDialog.py	(revision ddff053bb27a3db5489cf1f99a890f18c226279e)
@@ -13,5 +13,5 @@
     #def __init__(self, parent, id, title):
     def __init__(self, parent, plottable, push_data,transform, id, title):
-        wx.Dialog.__init__(self, parent, id, title, size=(450, 300))
+        wx.Dialog.__init__(self, parent, id, title, size=(450, 500))
         """
             for the fit window
@@ -23,5 +23,6 @@
         #dialog self plottable
         self.plottable = plottable
-        
+        # Receive transformations of x and y
+        self.xtrans,self.ytrans= self.transform()
         #Dialog interface
         panel = wx.Panel(self, -1, style=wx.SIMPLE_BORDER)   
@@ -38,4 +39,6 @@
         self.FXmin = wx.TextCtrl(panel,-1,size=(120,20),style=wx.SIMPLE_BORDER)
         self.FXmax = wx.TextCtrl(panel,-1,size=(120,20),style=wx.SIMPLE_BORDER)
+        self.FXminX = wx.TextCtrl(panel,-1,size=(120,20),style=wx.SIMPLE_BORDER)
+        self.FXmaxX = wx.TextCtrl(panel,-1,size=(120,20),style=wx.SIMPLE_BORDER)
         self.PXmin = wx.TextCtrl(panel,-1,size=(120,20),style=wx.SIMPLE_BORDER)
         self.PXmax = wx.TextCtrl(panel,-1,size=(120,20),style=wx.SIMPLE_BORDER)
@@ -89,4 +92,8 @@
         sizer.Add(self.PXmax, (iy, ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
         iy += 1
+        ix = 1
+        sizer.Add(wx.StaticText(panel, -1,"x transofrmation is: "+self.xtrans ),(iy, ix),(1,1),\
+                   wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
+        iy += 1
         ix = 0
         sizer.Add(wx.StaticText(panel, -1, 'Fit Range'),(iy, ix),(1,1),\
@@ -97,4 +104,18 @@
         ix += 2
         sizer.Add(self.FXmax, (iy, ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
+        
+        #iy += 1
+        #ix = 1
+        #sizer.Add(wx.StaticText(panel, -1,"x is: "),(iy, ix),(1,1),\
+        #           wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
+        iy += 1
+        ix = 0
+        sizer.Add(wx.StaticText(panel, -1, 'Fit Range of x'),(iy, ix),(1,1),\
+                   wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
+        ix += 1
+        sizer.Add(self.FXminX, (iy, ix),(1,1),\
+                   wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0)
+        ix += 2
+        sizer.Add(self.FXmaxX, (iy, ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
         iy += 1
         ix = 1
@@ -131,10 +152,13 @@
             self.FXmin.SetLabel(str(self.mini))
             self.FXmax.SetLabel(str(self.maxi))
-            
+            self.FXminX.SetLabel(str(self.mini))
+            self.FXmaxX.SetLabel(str(self.maxi))
+            self.FXmin.Disable()
+            self.FXmax.Disable()
             self.PXmin.SetValue(str(self.mini))
             self.PXmax.SetValue(str(self.maxi))
             self.PXmin.Disable()
             self.PXmax.Disable()
-    
+        
         # new data for the fit 
         #self.file_data1 = Theory1D(x=[], y=[], dy=None)
@@ -153,5 +177,5 @@
         tempy=[]
         tempdy = []
-        
+       
         #store the values of View in x,y, dx,dy
         x,y,dx,dy=self.plottable.returnValuesOfView()
@@ -162,10 +186,16 @@
         # makes transformation for y as a line to fit
         if x != []: 
+            
+                
             if(self.checkFitValues(self.FXmin) == True):
                 #Check if the field of Fit Dialog contain values and use the x max and min of the user
-                xmin,xmax = self._checkVal(self.FXmin.GetValue(),self.FXmax.GetValue())
+                xmin,xmax = self._checkVal(self.FXminX.GetValue(),self.FXmaxX.GetValue())
+                
                 xminView=self.floatTransform(xmin)
                 xmaxView=self.floatTransform(xmax)
-                
+                self.FXmin.SetValue(str(xminView))
+                self.FXmax.SetValue(str(xmaxView))
+                self.FXmin.Disable()
+                self.FXmax.Disable()
                 # Store the transformed values of view x, y,dy in variables  before the fit
                 if  self.ytrans.lower() == "log10(y)":
@@ -197,4 +227,5 @@
                        
                 #Find the fitting parameters
+                
                 if (self.xtrans.lower() == "log10(x)"):
                     chisqr, out, cov = fittings.sansfit(self.model, [self.cstA, self.cstB],
@@ -251,18 +282,6 @@
                 else: 
                     tempy.append(y_model)
-              
-                # Create new data plottable with result
-                #self.file_data1.x =[] 
-                #self.file_data1.y =[] 
-                #self.file_data1.x =tempx  
-                #self.file_data1.y =tempy     
-                #self.file_data1.dx=None
-                #self.file_data1.dy=None
-                #Load the view with the new values
-                #self.file_data1.reset_view()
-                
-                #Send the data to display to the PlotPanel
-                #self.push_data(self.file_data1,xminView,xmaxView)
-                self.push_data(tempx,tempy,xminView,xmaxView)
+               
+                self.push_data(tempx,tempy,xminView,xmaxView,xmin,xmax)
                 
                 # Display the fitting value on the Fit Dialog
@@ -289,15 +308,15 @@
         if float(usermin) < float(usermax):
             if float(usermin) >= float(self.mini) and float(usermin) < float(self.maxi):
-                self.FXmin.SetValue(str(usermin))
+                self.FXminX.SetValue(str(usermin))
             else:
-                self.FXmin.SetValue(str(self.mini))
+                self.FXminX.SetValue(str(self.mini))
                 
             if float(usermax) > float(self.mini) and float(usermax) <= float(self.maxi):
-                self.FXmax.SetLabel(str(usermax))
+                self.FXmaxX.SetLabel(str(usermax))
             else:
-                self.FXmax.SetLabel(str(self.maxi))
-                
-            mini =float(self.FXmin.GetValue())
-            maxi =float(self.FXmax.GetValue())
+                self.FXmaxX.SetLabel(str(self.maxi))
+                
+            mini =float(self.FXminX.GetValue())
+            maxi =float(self.FXmaxX.GetValue())
             
             return mini, maxi
@@ -337,5 +356,14 @@
         return flag
        
-                
+    def setFitRange(self,xmin,xmax,Reelxmin,Reelxmax):
+       
+        self.FXmin.SetValue(str(math.log10(xmin)))
+        self.FXmax.SetValue(str(math.log10(xmax)))
+        
+        self.FXmin.SetValue(str(xmin))
+        self.FXmax.SetValue(str(xmax))
+        self.FXminX.SetValue(str(Reelxmin))
+        self.FXmaxX.SetValue(str(Reelxmax))
+        
    
 if __name__ == "__main__": 
Index: guitools/plottables.py
===================================================================
--- guitools/plottables.py	(revision bbec827a62dd9a38aa3499ec4e2d1c2309d427ba)
+++ guitools/plottables.py	(revision ddff053bb27a3db5489cf1f99a890f18c226279e)
@@ -447,5 +447,5 @@
         dx = None
         dy = None
-        ID = ""
+
         
         def __init__(self, x=None, y=None, dx=None, dy=None):
@@ -641,5 +641,4 @@
         """
         self.name = "data"
-        self.ID= ""
         self.x = x
         self.y = y
@@ -680,5 +679,4 @@
         self.y = y
         self.dy = dy
-        self.ID= ""
         self.xaxis( 'q', 'A')
         self.yaxis( 'intensity', 'cm')
