Change axis label Color (JFreeChart)

Viewed 28

Can anyone tell me how I can proceed to change the color of the axes' labels as circled below?

enter image description here

1 Answers

You can use setTickLabelPaint() and setLabelPaint() like this:

Axis domain = plot.getDomainAxis();
domain.setTickLabelPaint(Color.blue);
domain.setLabelPaint(Color.blue);
Axis range = plot.getRangeAxis();
range.setTickLabelPaint(Color.red);
range.setLabelPaint(Color.red);
Related