Index: guitools/PlotPanel.py
===================================================================
--- guitools/PlotPanel.py	(revision c87d55a45e57622985ea41022323206eae4cd3da)
+++ guitools/PlotPanel.py	(revision 3755d77dd1f4e2ab6dee7b2d899e977bc89c828b)
@@ -1,4 +1,10 @@
 import wx.lib.newevent
-import matplotlib
+try:
+    import matplotlib
+except:
+    import pkg_resources
+    pkg_resources.require("matplotlib<0.92.0")
+    import matplotlib
+    
 matplotlib.interactive(False)
 #Use the WxAgg back end. The Wx one takes too long to render
Index: guitools/data_generator/logx_y_err.txt
===================================================================
--- guitools/data_generator/logx_y_err.txt	(revision 3755d77dd1f4e2ab6dee7b2d899e977bc89c828b)
+++ guitools/data_generator/logx_y_err.txt	(revision 3755d77dd1f4e2ab6dee7b2d899e977bc89c828b)
@@ -0,0 +1,54 @@
+#y=A*x+B
+#A=2.5
+#B=4
+-0.05	 4.0      0.4
+1.02329  3.86403  0.28175
+1.17766  4.37831  0.292429
+1.35532  4.56683  0.303107
+1.55977  4.20409  0.313786
+1.79507  4.08485  0.324464
+2.06587  4.51021  0.335143
+2.37751  5.26311  0.345821
+2.73617  5.38814  0.3565
+3.14893  5.07423  0.367179
+3.62396  5.32327  0.377857
+4.17065  5.86822  0.388536
+4.79981  5.96217  0.399214
+5.52389  5.75645  0.409893
+6.35719  5.84155  0.420571
+7.3162  6.40591  0.43125
+8.41988  6.56081  0.441929
+9.69006  6.31241  0.452607
+11.1519  6.93106  0.463286
+12.8342  6.41109  0.473964
+14.7702  6.79778  0.484643
+16.9984  6.78927  0.495321
+19.5627  7.75899  0.506
+22.5138  7.25194  0.516679
+25.9101  7.12548  0.527357
+29.8188  7.29804  0.538036
+34.3171  7.94993  0.548714
+39.494  7.50539  0.559393
+45.4518  8.18646  0.570071
+52.3084  8.49378  0.58075
+60.1994  7.96805  0.591429
+69.2807  7.95047  0.602107
+79.732  8.2302  0.612786
+91.7599  8.8321  0.623464
+105.602  8.62806  0.634143
+121.533  9.66039  0.644821
+139.867  8.40869  0.6555
+160.966  8.65932  0.666179
+185.249  9.26069  0.676857
+213.194  9.42869  0.687536
+245.356  11.4209  0.698214
+282.369  9.56875  0.708893
+324.965  11.4512  0.719571
+373.988  11.2271  0.73025
+430.405  10.6835  0.740929
+495.334  10.7465  0.751607
+570.057  11.605  0.762286
+656.053  11.2032  0.772964
+755.021  11.3974  0.783643
+868.92  10.708  0.794321
+1000  12.5551  0.805
Index: guitools/fitDialog.py
===================================================================
--- guitools/fitDialog.py	(revision 4ab1c91de771718c29565f8dd51d7f53af328153)
+++ guitools/fitDialog.py	(revision 3755d77dd1f4e2ab6dee7b2d899e977bc89c828b)
@@ -205,7 +205,15 @@
             self.x,self.y,self.dx,self.dy= self.plottable.returnValuesOfView()
             
-            self.mini =min(self.x)
-            self.maxi =max(self.x)
-            
+            #self.mini =min(self.x)
+            #self.maxi =max(self.x)
+            
+            try:
+                self.mini = self.floatForwardTransform(min(self.x))
+            except:
+                self.mini = "Invalid"
+            try:
+                self.maxi = self.floatForwardTransform(max(self.x))
+            except:
+                self.maxi = "Invalid"
             
             self.initXmin.SetValue(format_number(min(self.plottable.x)))
@@ -381,12 +389,12 @@
         if float(usermin) < float(usermax):
             if float(usermin) >= float(self.mini) and float(usermin) < float(self.maxi):
-                self.xminFit.SetValue(format_number(usermin))
+                self.xminFit.SetValue(format_number(float(usermin)))
             else:
-                self.xminFit.SetValue(format_number(self.mini))
+                self.xminFit.SetValue(format_number(float(self.mini)))
                 
             if float(usermax) > float(self.mini) and float(usermax) <= float(self.maxi):
-                self.xmaxFit.SetLabel(format_number(usermax))
+                self.xmaxFit.SetLabel(format_number(float(usermax)))
             else:
-                self.xmaxFit.SetLabel(format_number(self.maxi))
+                self.xmaxFit.SetLabel(format_number(float(self.maxi)))
                 
             mini =float(self.xminFit.GetValue())
@@ -394,4 +402,21 @@
             
             return mini, maxi
+        
+    def floatForwardTransform(self,x):
+        """
+             transform a float.
+        """
+        #TODO: refactor this with proper object-oriented design
+        # This code stinks.
+        
+        if ( self.xLabel=="x" ):
+            return transform.toX(x)
+        
+        if ( self.xLabel=="x^(2)" ): 
+            return transform.toX2(x)
+        
+        if (self.xLabel=="log10(x)" ):
+            return math.log10(x)
+            
     def floatTransform(self,x):
         """
@@ -427,5 +452,4 @@
         
         elif (self.xLabel=="log10(x)" ):
-            print "fitdialog: x",x
             return math.pow(10, x)
         
