I am plotting a number of series on a log-log XY plot, and I have a problem with autoscaling.
If I zoom in, the data looks fine. However, if I zoom out, the y-axis automatically scales so that its lowest value is 10e-101.
This problem is iontermittent and only occurs with some datasets. Any idea how I can control the autoscale limits of my axis??
Code: Select all
public ChartPanel mkRefErrorBarChart(XYIntervalSeriesCollection pointsColl, XYSeriesCollection linesColl, String name) {
linesColl.setIntervalWidth(0.0);
LogAxis yAxisLog = new LogAxis("Ref");
yAxisLog.setNumberFormatOverride(new LogFormat(10.0, "10e", true));
//Make the symbols plot....
XYErrorRenderer rendererPoints = new XYErrorRenderer();
rendererPoints.setShapesVisible(true);
rendererPoints.setShapesFilled(false);
rendererPoints.setLinesVisible(false);
//Make the lines plot....
XYLineAndShapeRenderer rendererLines = new XYLineAndShapeRenderer();
rendererLines.setLinesVisible(true);
rendererLines.setShapesVisible(false);
XYPlot plot = new XYPlot(pointsColl, refXAxisLog, yAxisLog, rendererPoints);
plot.setDataset(1,linesColl);
plot.setRenderer(1,rendererLines);
plot.setBackgroundPaint(Color.white);
plot.setDomainGridlinesVisible(false);
plot.setRangeGridlinesVisible(false);
JFreeChart chart = new JFreeChart("", plot);
chart.removeLegend();
chart.getPlot().setDrawingSupplier(new DefaultDrawingSupplier(
new Paint[] {VERY_DARK_RED,
VERY_DARK_GREEN,
VERY_DARK_BLUE,
VERY_DARK_MAGENTA,
VERY_DARK_YELLOW,
DARK_RED,
DARK_GREEN,
DARK_BLUE,
DARK_MAGENTA},
DefaultDrawingSupplier.DEFAULT_OUTLINE_PAINT_SEQUENCE,
DefaultDrawingSupplier.DEFAULT_STROKE_SEQUENCE,
DefaultDrawingSupplier.DEFAULT_OUTLINE_STROKE_SEQUENCE,
DefaultDrawingSupplier.DEFAULT_SHAPE_SEQUENCE));
final ChartPanel panel = new ChartPanel(chart);
panel.getChartRenderingInfo().setEntityCollection(null);
panel.setDisplayToolTips(false);
this.refChart = chart;
return panel;
}