JFreeChart 中的图表

发布于 2024-12-22 08:57:33 字数 231 浏览 3 评论 0 原文

在 X 轴上,我的数据点(其中 20 个)的值介于 0 到 0.2 之间。我的 X 轴范围应为 0 到 1。
Y 轴上相应的值在 0.8 到 0.86 之间。当我在 JFreeChart 中使用 NumberAxis 绘制此图时,我得到非常密集的图,特别是在 X 属于 0.01 到 0.02 的区间内。(所以我看不到太多)
在这种情况下,对 X 轴使用对数刻度有意义吗?我应该如何调整 JFreeChart 中的 LogAxis ?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

北方的韩爷 2024-12-29 08:57:33

使用 LogAxis< /a>,只需创建轴并将其设置为绘图的域:

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

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:

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.

我三岁 2024-12-29 08:57:33

使用对数刻度作为 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文