From: Benjamin R. <ben...@ou...> - 2010-10-03 16:12:54
|
On Fri, Oct 1, 2010 at 9:47 AM, Tony S Yu <ts...@gm...> wrote: > > On Oct 1, 2010, at 9:40 AM, Benjamin Root wrote: > > On Thu, Sep 30, 2010 at 8:44 PM, Tony S Yu <ts...@gm...> wrote: > >> I'd like to make something in between a box plot [1] and a histogram. Each >> histogram would be represented by a single, tall, rectangular patch (like >> the box in a box plot), and the patch would be subdivided by the bin edges >> of the histogram. The face color of each sub-patch would replace the bar >> height in the histogram. >> >> If any of that actually made sense: >> >> * Does this type of plot have a name? >> >> * Is there an easy way to do this in Matplotlib? >> >> * If there isn't an easy way, what would be a good starting point? Initial >> ideas: 1) Use pcolor or imshow and embed this axes in a larger axes, 2) >> represent the sub-patches as a PolyCollection. >> >> Thoughts? >> -Tony >> >> [1] e.g. >> http://matplotlib.sourceforge.net/examples/pylab_examples/boxplot_demo.html >> > > Tony, > > I am not quite sure I understand. > > > [snip] > > Or maybe something else in the gallery is more like what you want: > > http://matplotlib.sourceforge.net/gallery.html > > Ben Root > > > I've checked the gallery, but I don't see anything that appears similar. In > any case, I ended up hacking together something that works. I've attached an > image of what I had in mind (created with the code at the very bottom of > this reply). > > I ended up using mpl Rectangle objects and stringing them together using a > PatchCollection. Maybe there's a more efficient way to do this, but this > approach worked well-enough. > > Best, > -Tony > Actually, that looks kinda cool. If anyone is aware of the name for this kind of plot, maybe we could add a new plotting function? Ben Root |