In the horizontal y axis, what should i do if i wanted whole numbers like 1 or 2 to appear instead of the 0.25 , 0.5.
thanks
anup
setting horizontal axis values
Re: setting horizontal axis values
For any axis that is a subclass of NumberAxis, the following should work:
NumberAxis axis = (NumberAxis)plot.getRangeAxis();
// or NumberAxis axis = (NumberAxis)plot.getDomainAxis();
axis.setStandardTickUnits(TickUnits.createIntegerTickUnits());
You are free to create your own collection of standard tick units if you want different choices. The axis will automatically select an appropriate unit from the collection depending on the space available for the axis.
Regards,
DG.
NumberAxis axis = (NumberAxis)plot.getRangeAxis();
// or NumberAxis axis = (NumberAxis)plot.getDomainAxis();
axis.setStandardTickUnits(TickUnits.createIntegerTickUnits());
You are free to create your own collection of standard tick units if you want different choices. The axis will automatically select an appropriate unit from the collection depending on the space available for the axis.
Regards,
DG.