2

I'm need to create boxplots to analyse and evaluate test results. Since I program in Java this answer convinced me to use JFreeChart. The BoxAndWhisker chart seemed similar to what I wanted.

I spent the day to implement and create the dataset and the plot, but I'm confused with the result and also not very satisfied.

This is what I expected (the appearance/style not the values): What I expected This is what I got: what I got

Community
  • 1
  • 1
stefanbschneider
  • 5,460
  • 8
  • 50
  • 88

1 Answers1

2

The meaning of the symbols used in BoxAndWhiskerRenderer may be inferred from the drawItem() source code. For example, the mean is indeed drawn using an Ellipse2D, and it's visibility is controlled using the eponymous mutator, setMeanVisible(). Similarly, an empty ellipse represents an outlier. A complete example is shown here.

trashgod
  • 203,806
  • 29
  • 246
  • 1,045
  • Thanks. I was able to turn of the mean using `setMeanVisible(false)` and to set the series colors to black. But I don't get the empty circles/outliners yet. What do they represent? How can I change their shape (to smaller dots) or turn them off? Same goes for the arrows. And how are the Whiskers calculated? What confidence interval is used? – stefanbschneider Feb 04 '15 at 10:11
  • This is handled in your chosen concrete implementation of `BoxAndWhiskerCategoryDataset`. – trashgod Feb 04 '15 at 10:35
  • Are you sure the empty circles are called "outliers"? I'm looking for methods to set their color and shape, but I can't find anything. And there is nothing in the renderer's API with the word "outlier" in it. – stefanbschneider Feb 04 '15 at 21:14
  • @CGFoX: I don't see any methods to change the outliers' shape; the `BoxAndWhiskerCategoryDataset` controls the calculation; return an empty `List` to hide them. – trashgod Feb 04 '15 at 22:40
  • Hm, I'm fine with having the outliers, but the circles are pretty big and also I can't control their color seperatly from the series color. I found this [ExtendedBoxAndWhiskerRenderer](http://www.google.de/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0CCMQFjAA&url=http%3A%2F%2Fsourceforge.net%2Fp%2Fjfreechart%2Fpatches%2F_discuss%2Fthread%2F6bc32b11%2Fa735%2Fattachment%2FExtendedBoxAndWhiskerRenderer.java&ei=hJPSVOWdAoHFUqmRgLgM&usg=AFQjCNEBpctJHU5jiQhtHo8ThjM885qLsQ&sig2=A3lbTUyU2y2fFVPrGHhF1Q&bvm=bv.85142067,d.d24&cad=rja) which would be very helpful, but there are two classes missing... – stefanbschneider Feb 05 '15 at 08:11
  • 1
    All three files are attached in [patch 168](http://sourceforge.net/p/jfreechart/patches/168/). – trashgod Feb 05 '15 at 11:55
  • Thank you. I can now control the color and shape of the outliers and farouts, but for some reason the ExtendendBoxAndWhiskerRenderer ignores my settings to paint the outline black and to not paint the mean... – stefanbschneider Feb 05 '15 at 14:53
  • @CGFoX: Is there a graphics `fill()` v. `draw()` issue? – trashgod Feb 05 '15 at 20:28
  • I updated the question to clarify my remaining problems. It would be amazing if you could help with that, too. – stefanbschneider Feb 06 '15 at 10:31
  • This looks like a new question; be sure to include any modified source and a [complete example](http://stackoverflow.com/help/mcve) that focuses on the problem. – trashgod Feb 06 '15 at 11:06
  • A new question it is: http://stackoverflow.com/questions/28365288/jfreechart-boxplot-outlier-and-farout-appearance – stefanbschneider Feb 06 '15 at 11:58