Pierre GM wrote: >> And for the work I'm doing, I have a >> different number of observations and data points on different days, >> so it's a pain that the current boxplot infrastructure expects all of >> the boxes to be in a single array. Hence my questions. > > Ah OK, now I get it. Sorry for being a bit slow today. > So yes, there's a problem here. The sequence is transformed into an array > with 'asarray', which obviously won't work if you have different sizes of > dataset. > > But there's a trick, tested on numpy: > > import numpy > set1 = (rand(50)+1) * 100 > set2 = (rand(25)+2) * 100 > data = array([set1,set2], dtype=numpy.object_) > boxplot(data,positions=[732659.,732660.]) > > The trick here is to force the data as objects, and not as floats. Your array > is in fact an array of arrays of different sizes. That's enough to fool > asarray.
It sounds like the real problem is that the initial use of asarray in boxplot is a bug--it should transparently support an object array, as you suggest (but numpy only), or an ordinary array, *or* a list or tuple of data vectors, and all this should be clear in the docstring and the example. Correct? I hope so, because I have made the change in svn. (Well, maybe not enough changes to the example yet.) Eric ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users