From: Finny K. <kur...@mo...> - 2006-02-24 20:45:11
|
I've been having trouble gettin histograms to work on arrays. This is no= t the particular case that I've had, but illustrates the general error.=20 Wondering if anyone knew what I was doing wrong? Thanks. >>> from pylab import * >>> from numpy import * >>> x=3Dones([2,10]) >>> x array([[1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]]) >>> hist(x[0]) Traceback (most recent call last): File "<stdin>", line 1, in ? File "/usr/lib/python2.4/site-packages/matplotlib/pylab.py", line 1857, in hist ret =3D gca().hist(*args, **kwargs) File "/usr/lib/python2.4/site-packages/matplotlib/axes.py", line 1676, in hist n,bins =3D matplotlib.mlab.hist(x, bins, normed) File "/usr/lib/python2.4/site-packages/matplotlib/mlab.py", line 617, i= n hist ymin -=3D 0.5 TypeError: unsupported operand type(s) for -=3D: 'str' and 'float' |