I get a lovingly helpful traceback trying to use the histogram function that I'm hoping to get some useful help with. The data (and program) are at ftp://polar.sri.com/pub/ayoung: hist.dat and hist.py.
Thanks! Andrew
hist.py
···
--------
from matplotlib import pylab
f = open( 'hist.dat', 'r' )
xs = []
while( True ):
x = f.readline()
if x == "": break
xs.append( float(x) )
xs.sort()
pylab.hist( xs,100 )
[ayoung:ayoung@...1410... ~]$ python hist.py
Warning: invalid value encountered in multiply
Traceback (most recent call last):
File "hist.py", line 12, in ?
pylab.hist( xs,100 )
File "/usr/lib/python2.4/site-packages/matplotlib/pylab.py", line 1859, in hist
ret = gca().hist(*args, **kwargs)
File "/usr/lib/python2.4/site-packages/matplotlib/axes.py", line 4157, in hist
patches = self.bar(bins, n, width=width, bottom=bottom, align=align)
File "/usr/lib/python2.4/site-packages/matplotlib/axes.py", line 2566, in bar
self.autoscale_view()
File "/usr/lib/python2.4/site-packages/matplotlib/axes.py", line 982, in autoscale_view
XL = self.xaxis.get_major_locator().autoscale()
File "/usr/lib/python2.4/site-packages/matplotlib/ticker.py", line 847, in autoscale
return take(self.bin_boundaries(dmin, dmax), [0,-1])
File "/usr/lib/python2.4/site-packages/matplotlib/ticker.py", line 817, in bin_boundaries
scale, offset = scale_range(vmin, vmax, nbins)
File "/usr/lib/python2.4/site-packages/matplotlib/ticker.py", line 788, in scale_range
ex = divmod(math.log10(meanv), 1)[0]
OverflowError: math range error
Linux polar.sri.com 2.6.17-1.2142_FC4smp #1 SMP Tue Jul 11 22:57:02 EDT 2006 i686 i686 i386 GNU/Linux
Python 2.4.3 (#1, Jun 13 2006, 16:41:18)
matlab: __version__ = '0.85' __revision__ = '$Revision: 1.83 $'