I spent part of this weekend hacking together a chart renderer for JFreeChart that renders box-and-whisker datasets as quartile plots, the design Edward Tufte suggests in his book, The Visual Display of Quantitative Information. I was doing this for my paper on Ceph that I’m writing, because I was dissatisfied with the way the box-and-whisker renderer looked.
The code is here: QuartilePlotRenderer.java. I think this renderer needs a little more work, but here are some samples of what it produces. I mostly like the results of this renderer; I think the lines can cause a bit of vibration if they are too heavy and too close together, but for very small datasets, it looks pretty good. I haven’t come up with a good way to render the outliers yet, so they are simply omitted.
Here’s an example of the “dot and whisker” style. I like this one the best. It uses the least ink and makes for a striking design:

Here is the revision that changes the line weight for the interquartile range:

And here is the revision that offsets the interquartile range:


Loading...
Dave Gilbert | 20-Mar-07 at 5:47 am | Permalink
Great work, Casey! I like the first one best also. Is it OK if I try to integrate this into JFreeChart? The licence is GNU LGPL, as I’m sure you already noticed.
The source will require one or two changes, as I’m maintaining JFreeChart at the JDK 1.3.1 level (at least for a little while longer). But I think it will be straightforward to change.
csm | 20-Mar-07 at 4:40 pm | Permalink
I don’t mind at all if you integrate this into JFreeChart.
And yeah, it uses some Java-5 isms that need to be removed. Nothing too onerous, though.
Rob Wall | 29-Mar-07 at 7:23 pm | Permalink
Hi guys. I am going to be implementing a ‘Tukey Box Plot’ based on Jfree for ioGAS next week, which has two categories of outliers (near and far) that I’ll need to render. Do JFree renderers render outliers at all on box plots ( i couln’t see in example).?
Coincidentally I just read the Tufte book, and think the first plot above is excellent. I dislike the others (and remember thinking when reading the book that they looked silly).
I wonder if we can do Napoleans March in JFree :-).
Rob Wall.