boxplot with different data length

Dear All,

I am quite new to matplotlib and facing some trouble using boxplots.

I'd like to plot two boxes (different length of data) in one plot, from the docs
I understood:

from pylab import *

data = [[1.1, 2.1, 3.1], [1, 2.1]]
boxplot(data, positions=[1,2])

but this gives me:
Traceback (most recent call last):
  File "boxplot_demo1.py", line 5, in <module>
    data = array([[1.1, 2.1, 3.1], [1, 2.1]])
  File "D:\APPS\python25\lib\site-packages\numpy\oldnumeric\functions.py", line 79, in array
    return mu.array(sequence, dtype, copy=copy)
ValueError: setting an array element with a sequence.

The call succeeds if all entries have the same length, but then
matplotlib seems to use data from rows, not columns so that
Ihave to do:

boxplot(transpose(data), positions=[1,2])

Could you point me to what I do wrong? I need especially
the different data length.

Thank you
Gerhard

I am using python 2.5 matplotlib 0.87.7 on windows XP with numpy 1.0.1
(on older installation with python 2.4 and older numpy has the same issue.

···

****************************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. Access to this e-mail by anyone else is unauthorised.
If you are not the intended recipient, any disclosure, copying,
distribution or any action taken or omitted to be taken in reliance on
it, is prohibited.
E-mail messages are not necessarily secure. Renesas does not accept
responsibility for any changes made to this message after it was sent.
Please note that this email message has been swept by Renesas for
the presence of computer viruses.
****************************************************************************

Gerhard,
Try to install a SVN copy of matplotlib. Eric corrected that bug not long ago.
Alternatively, you can try to force your data into an array with
data = N.array(data, dtype=N.object)
beforehand.

···

On Monday 08 January 2007 04:34, Gerhard Spitzlsperger wrote:

Dear All,

I am quite new to matplotlib and facing some trouble using boxplots.

I'd like to plot two boxes (different length of data) in one plot, from
the docs

Could you point me to what I do wrong? I need especially
the different data length.