JFreeChart 中的图表
在 X 轴上,我的数据点(其中 20 个)的值介于 0 到 0.2 之间。我的 X 轴范围应为 0 到 1。
Y 轴上相应的值在 0.8 到 0.86 之间。当我在 JFreeChart 中使用 NumberAxis 绘制此图时,我得到非常密集的图,特别是在 X 属于 0.01 到 0.02 的区间内。(所以我看不到太多)
在这种情况下,对 X 轴使用对数刻度有意义吗?我应该如何调整 JFreeChart 中的 LogAxis ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用
LogAxis
< /a>,只需创建轴并将其设置为绘图的域:LogAxisDemo1
,显示在 XY 图表 中href="http://www.jfree.org/jfreechart/samples.html" rel="nofollow">demo,是一个完整的示例。LogarithmicAxis
可能是一个更具视觉吸引力的替代方案。To use
LogAxis
, just create the axis and set it as the plot's domain:LogAxisDemo1
, shown among the XY Charts in the demo, is a complete example.LogarithmicAxis
may be a more visually appealing alternative.使用对数刻度作为 x 坐标是明智的。一种无需尝试找出 LogAxis 正确语法的方法是将数据点从
{x, y}
转换为{log(x), y}
并使用正常线性比例制图。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.