I am calculating histogram of red component of the image and stored it in redhisto[]. The index of the array represent the intensity(0 to 255) and the value represent the n
You can change the lower bound of the domain axis and set the series paint as shown below. The default XYBarPainter
has a gradient color highlight, so I used a StandardXYBarPainter
.
XYPlot plot = (XYPlot) chart.getPlot();
ValueAxis axis = plot.getDomainAxis();
axis.setLowerBound(0);
XYBarRenderer r = (XYBarRenderer) plot.getRenderer();
r.setBarPainter(new StandardXYBarPainter());
r.setSeriesPaint(0, Color.blue);