Index: guitools/PlotPanel.py
===================================================================
--- guitools/PlotPanel.py	(revision 150c04a24a22c547a7794c40bfb8d089fe3ff50b)
+++ guitools/PlotPanel.py	(revision b43a00952d61f7d74e84e0fd6420c550eadbfaab)
@@ -116,6 +116,6 @@
         self.symbollist = ['o','x','^','v','<','>','+','s','d','D','h','H','p']
         #User scale
-        self.xscales ="x"
-        self.yscales ="log10(y)"
+        self.xLabel ="x"
+        self.yLabel ="log10(y)"
         self.viewModel ="--"
         # keep track if the previous transformation of x and y in Property dialog
@@ -128,8 +128,25 @@
         #self.fit_result = Data1D(x=[], y=[],dx=None, dy=None)
         self.fit_result.name = "Fit"
+        # For fit Dialog initial display
         self.xmin=0.0
         self.xmax=0.0
         self.xminView=0.0
         self.xmaxView=0.0
+        self.Avalue=None
+        self.Bvalue=None
+        self.ErrAvalue=None
+        self.ErrBvalue=None
+        self.Chivalue=None
+    def resetFitView(self):
+        # For fit Dialog initial display
+        self.xmin=0.0
+        self.xmax=0.0
+        self.xminView=0.0
+        self.xmaxView=0.0
+        self.Avalue=None
+        self.Bvalue=None
+        self.ErrAvalue=None
+        self.ErrBvalue=None
+        self.Chivalue=None
     def onWheel(self, event):
         """
@@ -175,5 +192,6 @@
 
     def returnTrans(self):
-        return self.xscales,self.yscales
+        return self.xLabel,self.yLabel, self.Avalue, self.Bvalue,\
+        self.ErrAvalue,self.ErrBvalue,self.Chivalue
     
     def setTrans(self,xtrans,ytrans): 
@@ -196,4 +214,5 @@
             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):
@@ -215,10 +234,10 @@
                 dial.setValues( self.prevXtrans, self.prevYtrans,self.viewModel )
                 if dial.ShowModal() == wx.ID_OK:
-                    self.xscales, self.yscales,self.viewModel = dial.getValues()
+                    self.xLabel, self.yLabel,self.viewModel = dial.getValues()
                     if self.viewModel =="Guinier lny vs x^(2)":
-                        self.xscales="x^(2)"
-                        self.yscales="ln(y)"
+                        self.xLabel="x^(2)"
+                        self.yLabel="ln(y)"
                         self.viewModel = "--"
-                        dial.setValues( self.xscales, self.yscales,self.viewModel )
+                        dial.setValues( self.xLabel, self.yLabel,self.viewModel )
                     self._onEVT_FUNC_PROPERTY()
                 dial.Destroy()
@@ -456,61 +475,61 @@
         
         for item in list:
-            item.getTransform(self.xscales,self.yscales)
-            if ( self.xscales=="x" ):
-                item.returnTransformationx(transform.toX,transform.errToX)
+            item.setLabel(self.xLabel,self.yLabel)
+            if ( self.xLabel=="x" ):
+                item.transformX(transform.toX,transform.errToX)
                 self.set_xscale("linear")
                 name, units = item.get_xaxis()
                 self.graph.xaxis("%s" % name,  "%s^{-1}" % units)
                 
-            if ( self.xscales=="x^(2)" ):
-                item.returnTransformationx(transform.toX2,transform.errToX2)
+            if ( self.xLabel=="x^(2)" ):
+                item.transformX(transform.toX2,transform.errToX2)
                 self.set_xscale('linear')
                 name, units = item.get_xaxis()
                 self.graph.xaxis("%s^{2}" % name,  "%s^{-2}" % units)
                 
-            if (self.xscales=="log10(x)" ):
-                item.returnTransformationx(transform.toX,transform.errToX)
+            if (self.xLabel=="log10(x)" ):
+                item.transformX(transform.toX,transform.errToX)
                 self.set_xscale("log")
                 name, units = item.get_xaxis() 
                 self.graph.xaxis("\log_{10}\ \  %s" % name,  "%s^{-1}" % units)
                 
-            if ( self.yscales=="ln(y)" ):
-                item.returnTransformationy(transform.toLogX,transform.errToLogX)
+            if ( self.yLabel=="ln(y)" ):
+                item.transformY(transform.toLogX,transform.errToLogX)
                 self.set_yscale("linear")
                 name, units = item.get_yaxis()
                 self.graph.yaxis("log\ \ %s" % name,  "%s^{-1}" % units)
                 
-            if ( self.yscales=="y" ):
-                item.returnTransformationy(transform.toX,transform.errToX)
+            if ( self.yLabel=="y" ):
+                item.transformY(transform.toX,transform.errToX)
                 self.set_yscale("linear")
                 name, units = item.get_yaxis()
                 self.graph.yaxis("%s" % name,  "%s^{-1}" % units)
                 
-            if ( self.yscales=="log10(y)" ): 
-                item.returnTransformationy(transform.toX,transform.errToX)
+            if ( self.yLabel=="log10(y)" ): 
+                item.transformY(transform.toX,transform.errToX)
                 self.set_yscale("log")  
                 name, units = item.get_yaxis()
                 self.graph.yaxis("\log_{10}\ \ %s" % name,  "%s^{-1}" % units)
                 
-            if ( self.yscales=="y^(2)" ):
-                item.returnTransformationy( transform.toX2,transform.errToX2 )    
+            if ( self.yLabel=="y^(2)" ):
+                item.transformY( transform.toX2,transform.errToX2 )    
                 self.set_yscale("linear")
                 name, units = item.get_yaxis()
                 self.graph.yaxis("%s^{2}" % name,  "%s^{-2}" % units)
                 
-            if ( self.yscales =="1/y"):
-                item.returnTransformationy(transform.toOneOverX,transform.errOneOverX )
+            if ( self.yLabel =="1/y"):
+                item.transformY(transform.toOneOverX,transform.errOneOverX )
                 self.set_yscale("linear")
                 name, units = item.get_yaxis()
                 self.graph.yaxis("%s" % name,  "\ \%s" % units)
                 
-            if ( self.yscales =="1/sqrt(y)" ):
-                item.returnTransformationy(transform.toOneOverSqrtX,transform.errOneOverSqrtX )
+            if ( self.yLabel =="1/sqrt(y)" ):
+                item.transformY(transform.toOneOverSqrtX,transform.errOneOverSqrtX )
                 self.set_yscale("linear")
                 name, units = item.get_yaxis()
                 self.graph.yaxis("\sqrt{%s}" %name,  "%s" % units)
                 
-            if ( self.yscales =="ln(y*x)"):
-                item.returnTransformationy( transform.toLogXY,transform.errToLogXY)
+            if ( self.yLabel =="ln(y*x)"):
+                item.transformY( transform.toLogXY,transform.errToLogXY)
                 self.set_yscale("linear")
                 yname, yunits = item.get_yaxis()
@@ -518,6 +537,6 @@
                 self.graph.yaxis("log\ %s %s" % (yname,xname),  "%s^{-1}%s^{-1}" % (yunits,xunits))
                 
-            if ( self.yscales =="ln(y*x^(2))"):
-                item.returnTransformationy( transform.toLogYX2,transform.errToLogYX2)
+            if ( self.yLabel =="ln(y*x^(2))"):
+                item.transformY( transform.toLogYX2,transform.errToLogYX2)
                 self.set_yscale("linear")
                 yname, yunits = item.get_yaxis()
@@ -525,6 +544,6 @@
                 self.graph.yaxis("Log %s%s^{2}" % (yname,xname),  "%s^{-1}%s^{-2}" % (yunits,xunits))
             
-            if ( self.yscales =="ln(y*x^(4))"):
-                item.returnTransformationy(transform.toLogYX4,transform.errToLogYX4)
+            if ( self.yLabel =="ln(y*x^(4))"):
+                item.transformY(transform.toLogYX4,transform.errToLogYX4)
                 self.set_yscale("linear")
                 yname, yunits = item.get_yaxis()
@@ -533,24 +552,28 @@
             
             if ( self.viewModel == "Guinier lny vs x^(2)"):
-                item.returnTransformationx(transform.toX2,transform.errToX2)
+                
+                item.transformX(transform.toX2,transform.errToX2)
                 self.set_xscale('linear')
                 name, units = item.get_xaxis()
                 self.graph.xaxis("%s^{2}" % name,  "%s^{-2}" % units)
-                item.returnTransformationy(transform.toLogX,transform.errToLogX )
+                
+                item.transformY(transform.toLogX,transform.errToLogX )
                 self.set_yscale("linear")
                 name, units = item.get_yaxis()
                 self.graph.yaxis("$Log %s$" % name,  "%s^{-1}" % units)
+                
             item.transformView()
-        #item.name = self.yscales+" vs " +self.xscales  
+            
+        #item.name = self.yLabel+" vs " +self.xLabel  
         self.xmin=0.0
         self.xmax=0.0
         self.xminView=0.0
         self.xmaxView=0.0    
-        self.prevXtrans = self.xscales 
-        self.prevYtrans = self.yscales  
+        self.prevXtrans = self.xLabel 
+        self.prevYtrans = self.yLabel  
         self.graph.render(self)
         self.subplot.figure.canvas.draw_idle()
         
-    def onFitDisplay(self, tempx,tempy,xminView,xmaxView,xmin,xmax):
+    def onFitDisplay(self, tempx,tempy,xminView,xmaxView,xmin,xmax,func):
         """
             Add a new plottable into the graph .In this case this plottable will be used 
@@ -558,5 +581,5 @@
             @param plottable: the plottable to plot
         """
-        
+        self.Avalue,self.Bvalue,self.ErrAvalue,self.ErrBvalue,self.Chivalue=func
         
         list =[]
