I have a simple, but frustrating problem.
I need to plot a number of series onto a boxplot. Some sample
code looks as follows:
from pylab import *
from scipy import array
jan = array([46, 38, 28, 14, 11, 7, 4, 3, 3, 3, 3, 3, 3, 2, 2, 1])
#jan = array([46, 38, 28, 14, 11, 7, 4, 3, 3, 3, 3, 3]) #this length
feb = array([ 2, 12, 3, 3, 13, 10, 17, 6, 6, 6, 3, 3])
jan.shape = (-1, 1)
feb.shape = (-1, 1)
series = concatenate( (jan, feb), 1 )
(In Real Life, of course, the data arrays are built up elsewhere
and passed into the plotting function...)
The problem is that I get the error:
ValueError: array dimensions must agree except for d_0
because jan and feb have different lengths - however, I have no
over the size of these arrays - they vary greatly according to
How do I plot multiple. variable-length array on the same boxplot?
This message is subject to the CSIR's copyright, terms and conditions and
e-mail legal notice. Views expressed herein do not necessarily represent the
views of the CSIR.
CSIR E-mail Legal Notice
CSIR Copyright, Terms and Conditions
For electronic copies of the CSIR Copyright, Terms and Conditions and the CSIR
Legal Notice send a blank message with REQUEST LEGAL in the subject line to
This message has been scanned for viruses and dangerous content by MailScanner,
and is believed to be clean.