his problems...

HI all,

I've been using matplotlip for a while now but mainly for line plots,
scatter plots and the odd dendrogram. I recently tried plotting a
histogram (of a binomial function) and encountered a problem. So I
though I'd try the extremely simple example set on the front of the
matplotlib page.... and heres what I got:

Python 2.4.3 (#1, Sep 3 2009, 15:37:12)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

from pylab import randn, hist
x = randn(10000)
hist(x, 100)

Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/python2.4/site-packages/matplotlib/pyplot.py", line
1633, in hist
    ret = gca().hist(*args, **kwargs)
  File "/usr/lib/python2.4/site-packages/matplotlib/axes.py", line 5060, in hist
    align=align, log=log)
  File "/usr/lib/python2.4/site-packages/matplotlib/axes.py", line 3253, in bar
    assert len(height)==nbars, "argument 'height' must be %d or scalar" % nbars
AssertionError: argument 'height' must be 101 or scalar

Any idea why this isn't working? I have matplotlib v0.91.2 - will
updating to 0.99 solve the problem?

···

--
Cheers,

Nick Schurch

HI all,

I've been using matplotlip for a while now but mainly for line plots,
scatter plots and the odd dendrogram. I recently tried plotting a
histogram (of a binomial function) and encountered a problem. So I
though I'd try the extremely simple example set on the front of the
matplotlib page.... and heres what I got:

Python 2.4.3 (#1, Sep 3 2009, 15:37:12)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

>>> from pylab import randn, hist
>>> x = randn(10000)
>>> hist(x, 100)

Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/python2.4/site-packages/matplotlib/pyplot.py", line
1633, in hist
    ret = gca().hist(*args, **kwargs)
  File "/usr/lib/python2.4/site-packages/matplotlib/axes.py", line 5060, in
hist align=align, log=log)
  File "/usr/lib/python2.4/site-packages/matplotlib/axes.py", line 3253, in
bar assert len(height)==nbars, "argument 'height' must be %d or scalar" %
nbars AssertionError: argument 'height' must be 101 or scalar

Any idea why this isn't working? I have matplotlib v0.91.2 - will
updating to 0.99 solve the problem?

Hi,

I'm using

Python 2.5.2 (r252:60911, Jan 20 2010, 21:48:48)
[GCC 4.2.4 (Ubuntu 4.2.4-1ubuntu3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

from pylab import randn, hist, show
x = randn(10000)
hist(x, 100)
show()
import matplotlib
matplotlib.__version__

'0.91.2'

and get a nice figure with a 100-bins histogram. I don't know what's going
wrong with your installation.

Kind regards,
Matthias

···

On Tuesday 09 February 2010 17:38:18 Nick Schurch wrote: