Graph Plot in JFreeChart

2019-03-06 07:39发布

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?

2条回答
Luminary・发光体
2楼-- · 2019-03-06 08:02

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.

查看更多
不美不萌又怎样
3楼-- · 2019-03-06 08:17

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.

查看更多
登录 后发表回答