Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project!

## Re: [Matplotlib-users] box plot on noisy data

 Re: [Matplotlib-users] box plot on noisy data From: Eric Wertman - 2008-09-12 15:15:58 ```>> import pylab as pb >> vals = [ [1,2,3,4,5], [10,20,30,40]] >> pb.boxplot( vals) >> pb.show() >> >> This gives: >> Traceback (most recent call last): ... >> ValueError: setting an array element with a sequence. I had this problem just recently... It wasn't so much the box plot as the numpy array. I ended up plotting a list of numpy arrays of different lengths, rather than a single 2 dimensional array. Try: vals = [numpy.array([1,2,3,4,5]),numpy.array([10,20,30,40])] and see if it works? Eric ```

 Re: [Matplotlib-users] box plot on noisy data From: Christoph T. Weidemann - 2008-09-12 12:42:34 ```On Thu, 11 Sep 2008 21:02:30 -0600, Steve Sullivan wrote: > But boxplot seems to demand that each box represent the same > number of values. For example, if day 1 had 5 observations > and day 2 had only 4 obs, we'd have the program: > > import pylab as pb > vals = [ [1,2,3,4,5], [10,20,30,40]] > pb.boxplot( vals) > pb.show() > > This gives: > Traceback (most recent call last): ... > ValueError: setting an array element with a sequence. This example works fine for me using matplotlib version 0.98.3 and I've also made many boxplots with unequal numbers of elements with earlier matplotlib versions. ```
 Re: [Matplotlib-users] box plot on noisy data From: Eric Wertman - 2008-09-12 15:15:58 ```>> import pylab as pb >> vals = [ [1,2,3,4,5], [10,20,30,40]] >> pb.boxplot( vals) >> pb.show() >> >> This gives: >> Traceback (most recent call last): ... >> ValueError: setting an array element with a sequence. I had this problem just recently... It wasn't so much the box plot as the numpy array. I ended up plotting a list of numpy arrays of different lengths, rather than a single 2 dimensional array. Try: vals = [numpy.array([1,2,3,4,5]),numpy.array([10,20,30,40])] and see if it works? Eric ```