0

On the X axis my data points(20 of them) take values between 0 and 0.2. My X axis should have range from 0 to 1.
On the Y axis corresponding values are between 0.8 and 0.86. When I plot this graph using NumberAxis in JFreeChart I get very dense graph especially in the interval X belongs to 0.01 to 0.02.(so I can't see much)
Is it meaningful to use log scale for X axis in this case? How should I adjust LogAxis in JFreeChart here?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
ilija
  • 543
  • 1
  • 11
  • 19

2 Answers2

1

To use LogAxis, just create the axis and set it as the plot's domain:

LogAxis xAxis = new LogAxis("X");
plot.setDomainAxis(xAxis);

LogAxisDemo1, shown among the XY Charts in the demo, is a complete example. LogarithmicAxis may be a more visually appealing alternative.

trashgod
  • 203,806
  • 29
  • 246
  • 1,045
0

Using log scale for x-coordinates is sensible. One approach without trying to figure out the right syntax for LogAxis is to transform the data points from {x, y} to {log(x), y} and use the normal linear scale charting.

Meng Lu
  • 13,726
  • 12
  • 39
  • 47