Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Rightclick on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
From: John Pyle <john@ot...>  20050316 23:27:01

Hello, When I run: from pylab import * data = [1.6e012, 3.0e012] plot(data) the y axis autoscales to 1.8e12  3.2e12. I get the same behavior when I run in interactive mode or save the figure to png. Does anyone know if this is a bug or if there's something I can do to make the autoscaling work out? Thanks, John P.S. Here's the output from the verbosehelpful flag: matplotlib data path c:\pyle\python23\share\matplotlib loaded rc file c:\pyle\python23\share\matplotlib\.matplotlibrc matplotlib version 0.72.1 verbose.level helpful interactive is False platform is win32 numerix numarray 1.2.2 font search path ['c:\\pyle\\python23\\share\\matplotlib'] loaded ttfcache file C:/msys/1.0/home/artsys\.ttffont.cache backend Agg version v2.2 
From: Darren Dale <dd55@co...>  20050317 00:59:17

Hi John, It is a bug. I suggest making the following change to ticker.py, starting at line 501 in version 0.72.1: def le(self, x): 'return the largest multiple of base <= x' d,m = divmod(x, self._base) if closeto(m/self._base,1): # was closeto(m, self._base) #looks like floating point error return (d+1)*self._base else: return d*self._base Darren On Wednesday 16 March 2005 06:26 pm, John Pyle wrote: > Hello, > > When I run: > > from pylab import * > data = [1.6e012, 3.0e012] > plot(data) > > the y axis autoscales to 1.8e12  3.2e12. I get the same behavior when > I run in interactive mode or save the figure to png. > > Does anyone know if this is a bug or if there's something I can do to > make the autoscaling work out? > > Thanks, > John > > > P.S. Here's the output from the verbosehelpful flag: > > matplotlib data path c:\pyle\python23\share\matplotlib > loaded rc file c:\pyle\python23\share\matplotlib\.matplotlibrc > matplotlib version 0.72.1 > verbose.level helpful > interactive is False > platform is win32 > numerix numarray 1.2.2 > font search path ['c:\\pyle\\python23\\share\\matplotlib'] > loaded ttfcache file C:/msys/1.0/home/artsys\.ttffont.cache > backend Agg version v2.2 > > > >  > SF email is sponsored by  The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > Matplotlibusers mailing list > Matplotlibusers@... > https://lists.sourceforge.net/lists/listinfo/matplotlibusers  Darren 
From: Darren Dale <dd55@co...>  20050317 01:36:12

On Wednesday 16 March 2005 07:59 pm, Darren Dale wrote: > I suggest making the following change to ticker.py, starting > at line 501 in version 0.72.1: > > def le(self, x): > 'return the largest multiple of base <= x' > d,m = divmod(x, self._base) > if closeto(m/self._base,1): # was closeto(m, self._base) > #looks like floating point error > return (d+1)*self._base > else: > return d*self._base > I was testing this bugfix with plot([1.4e12,3.0e12]), and noticed that the 1.4e12 ticklabel was being dropped. In ticker.py, I suggest replacing Base.ge with: def ge(self, x): 'return the largest multiple of base >= x' d,m = divmod(x, self._base) if closeto(m,0) and not closeto(m/self._base,1): return x return (d+1)*self._base The fourth line used to be if m==0: return x, which fails sometimes due to floating point inaccuracy. John, remember I was complaining about how certain ticklabels wouldnt get rendered in the new scalarformatter I posted a couple weeks ago? This was the problem. Darren 
From: John Pyle <john@ot...>  20050317 19:49:14

Darren, This works great for me  thanks! I should have said this earlier, but matplotlib is excellent! Thank you to everyone who works on it. John Darren Dale wrote: >On Wednesday 16 March 2005 07:59 pm, Darren Dale wrote: > > >>I suggest making the following change to ticker.py, starting >>at line 501 in version 0.72.1: >> >> def le(self, x): >> 'return the largest multiple of base <= x' >> d,m = divmod(x, self._base) >> if closeto(m/self._base,1): # was closeto(m, self._base) >> #looks like floating point error >> return (d+1)*self._base >> else: >> return d*self._base >> >> >> > >I was testing this bugfix with plot([1.4e12,3.0e12]), and noticed that the >1.4e12 ticklabel was being dropped. > >In ticker.py, I suggest replacing Base.ge with: > > def ge(self, x): > 'return the largest multiple of base >= x' > d,m = divmod(x, self._base) > if closeto(m,0) and not closeto(m/self._base,1): return x > return (d+1)*self._base > >The fourth line used to be if m==0: return x, which fails sometimes due to >floating point inaccuracy. John, remember I was complaining about how certain >ticklabels wouldnt get rendered in the new scalarformatter I posted a couple >weeks ago? This was the problem. > >Darren > > > 