List of usage examples for org.jfree.chart.renderer.category BoxAndWhiskerRenderer setStroke
public void setStroke(Stroke stroke)
From source file:edu.msu.cme.rdp.classifier.train.validation.distance.BoxPlotUtils.java
public static void createBoxplot(DefaultBoxAndWhiskerCategoryDataset scatterDataset, PrintStream outStream, String title, String xAxisLabel, String yAxisLabel, Font lableFont) throws IOException { CategoryAxis xAxis = new CategoryAxis(xAxisLabel); xAxis.setLabelFont(lableFont);//from w w w . ja v a 2 s. com NumberAxis yAxis = new NumberAxis(yAxisLabel); yAxis.setTickLabelFont(lableFont); yAxis.setAutoRangeIncludesZero(false); yAxis.setRange(0, 100); yAxis.setLabelFont(lableFont); BoxAndWhiskerRenderer renderer = new BoxAndWhiskerRenderer(); renderer.setFillBox(true); renderer.setBaseLegendTextFont(lableFont); renderer.setStroke(new BasicStroke(5.0f)); CategoryPlot plot = new CategoryPlot(scatterDataset, xAxis, yAxis, renderer); JFreeChart boxchart = new JFreeChart(title, new Font("Helvetica", Font.BOLD, 40), plot, true); // higher scale factor gives higher resolution ChartUtilities.writeScaledChartAsPNG(outStream, boxchart, 800, 1000, 3, 3); }