Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int number = 155897;//max number of Pixels
- HistogramDataset dataset = new HistogramDataset(); //create a Histogram
- dataset.setType(HistogramType.RELATIVE_FREQUENCY);
- dataset.addSeries("Histogram",doubleArray,number);
- String plotTitle = "Histogram";
- String xaxis = "pixel";
- String yaxis = "intensity";
- PlotOrientation orientation = PlotOrientation.VERTICAL;//sets the vertical orientation of the Histogram
- boolean show = false;
- boolean toolTips = false;
- boolean urls = false;
- JFreeChart chart = ChartFactory.createHistogram( plotTitle, xaxis, yaxis,
- dataset, orientation, show, toolTips, urls);
- int widthg = 500;
- int heightg = 300;
- try {
- ChartUtilities.saveChartAsPNG(new File("histogram41.PNG"), chart, widthg, heightg);
- } catch (IOException e) {}
- }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement