Skip to content

howto axis intersection

Erich Seifert edited this page Mar 14, 2016 · 1 revision

How can I move the y axis completely to the left or to the right?

You can use the intersection property of the axis renderer to move an axis to one side of the plotting area

To move the y-axis to the right:

AxisRenderer rendererY = plot.getAxisRenderer(XYPlot.AXIS_Y);
rendererY.setIntersection(Double.MAX_VALUE);

To move the y-axis to the left:

AxisRenderer rendererY = plot.getAxisRenderer(XYPlot.AXIS_Y);
rendererY.setIntersection(-Double.MAX_VALUE);

See also

How-to Change the origin of a plot