Advertisement
Guest User

Untitled

a guest
Nov 21st, 2014
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. int number = 155897;//max number of Pixels
  2. HistogramDataset dataset = new HistogramDataset(); //create a Histogram
  3. dataset.setType(HistogramType.RELATIVE_FREQUENCY);
  4. dataset.addSeries("Histogram",doubleArray,number);
  5. String plotTitle = "Histogram";
  6. String xaxis = "pixel";
  7. String yaxis = "intensity";
  8. PlotOrientation orientation = PlotOrientation.VERTICAL;//sets the vertical orientation of the Histogram
  9. boolean show = false;
  10. boolean toolTips = false;
  11. boolean urls = false;
  12. JFreeChart chart = ChartFactory.createHistogram( plotTitle, xaxis, yaxis,
  13. dataset, orientation, show, toolTips, urls);
  14. int widthg = 500;
  15. int heightg = 300;
  16. try {
  17. ChartUtilities.saveChartAsPNG(new File("histogram41.PNG"), chart, widthg, heightg);
  18. } catch (IOException e) {}
  19. }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement