Index: guitools/PlotPanel.py
===================================================================
--- guitools/PlotPanel.py	(revision ddff053bb27a3db5489cf1f99a890f18c226279e)
+++ guitools/PlotPanel.py	(revision 150c04a24a22c547a7794c40bfb8d089fe3ff50b)
@@ -35,8 +35,15 @@
         # Convert values into the correct scale for a linear transformation
         # TODO: use proper scale transformers
+        loprev = lo
+        hiprev = hi
+        ptprev = pt
         if scale=='log':
-            lo,hi = math.log10(lo),math.log10(hi)
+            #assert lo >0
+            if lo > 0 :
+                lo = math.log10(lo)
+            if hi > 0 :
+                hi = math.log10(hi)
             if pt is not None: pt = math.log10(pt)
-    
+        
         # Compute delta from axis range * %, or 1-% if persent is negative
         if step > 0:
@@ -54,7 +61,20 @@
         # Convert transformed values back to the original scale
         if scale=='log':
-            lo,hi = math.pow(10.,lo),math.pow(10.,hi)
-            print "check y axis rescale"
-    
+            #if (lo <= -300) and (hi >= 300):
+            if (lo > 0) and (math.log(lo) <= -300):
+                lo=loprev
+                hi=hiprev
+                print "Not possible to scale"
+            if (lo == 0) or (lo <= -300):
+                lo=loprev
+                hi=hiprev
+                print "Not possible to scale"
+            else:
+                lo,hi = math.pow(10.,lo),math.pow(10.,hi)
+                #assert lo >0,"lo = %g"%lo
+                print "possible to scale"
+           
+        print "these are low and high",lo,hi
+
         return (lo,hi)
 
@@ -137,9 +157,9 @@
                 if insidex:
                     xdata,_ = ax.transAxes.inverse_xy_tup((x,y))
-                    #print "xaxis",x,"->",xdata
+                    print "xaxis",x,"->",xdata
                 insidey,_ = ax.yaxis.contains(event)
                 if insidey:
                     _,ydata = ax.transAxes.inverse_xy_tup((x,y))
-                    #print "yaxis",y,"->",ydata
+                    print "yaxis",y,"->",ydata
             if xdata is not None:
                 lo,hi = ax.get_xlim()
@@ -150,5 +170,5 @@
                 lo,hi = _rescale(lo,hi,step,bal=ydata,scale=ax.get_yscale())
                 ax.set_ylim((lo,hi))
-
+               
         self.canvas.draw_idle()
 
@@ -522,5 +542,9 @@
                 self.graph.yaxis("$Log %s$" % name,  "%s^{-1}" % units)
             item.transformView()
-        #item.name = self.yscales+" vs " +self.xscales      
+        #item.name = self.yscales+" vs " +self.xscales  
+        self.xmin=0.0
+        self.xmax=0.0
+        self.xminView=0.0
+        self.xmaxView=0.0    
         self.prevXtrans = self.xscales 
         self.prevYtrans = self.yscales  
@@ -539,5 +563,6 @@
         list = self.graph.returnPlottable()
         for item in list:
-            item.onFitRange(xminView,xmaxView)
+            #item.onFitRange(xminView,xmaxView)
+            item.onFitRange(None,None)
         self.xminView=xminView
         self.xmaxView=xmaxView
Index: guitools/plottables.py
===================================================================
--- guitools/plottables.py	(revision ddff053bb27a3db5489cf1f99a890f18c226279e)
+++ guitools/plottables.py	(revision 150c04a24a22c547a7794c40bfb8d089fe3ff50b)
@@ -437,5 +437,5 @@
     def onReset(self):
         self.view.onResetView()
-    def onFitRange(self,xmin,xmax):
+    def onFitRange(self,xmin=None,xmax=None):
         self.view.onFitRangeView(xmin,xmax)
     class View:
@@ -608,5 +608,5 @@
                 self.dy=tempdy
                 
-        def onFitRangeView(self,xmin,xmax):
+        def onFitRangeView(self,xmin=None,xmax=None):
             tempx=[]
             tempdx=[]
@@ -617,14 +617,15 @@
             if self.dy==None:
                 self.dy=numpy.zeros(len(self.y))
-            for i in range(len(self.x)):
-                if ( self.x[i] >= xmin ) and ( self.x[i] <= xmax ):
-                    tempx.append(self.x[i])
-                    tempdx.append(self.dx[i])
-                    tempy.append(self.y[i])
-                    tempdy.append(self.dy[i])
-            self.x=tempx
-            self.y=tempy
-            self.dx=tempdx
-            self.dy=tempdy        
+            if ( xmin != None ) and ( xmax != None ):
+                for i in range(len(self.x)):
+                    if ( self.x[i] >= xmin ) and ( self.x[i] <= xmax ):
+                        tempx.append(self.x[i])
+                        tempdx.append(self.dx[i])
+                        tempy.append(self.y[i])
+                        tempdy.append(self.dy[i])
+                self.x=tempx
+                self.y=tempy
+                self.dx=tempdx
+                self.dy=tempdy        
 
 class Data1D(Plottable):
