使用 Java 处理绘制数据图形
我正在考虑用Java 中的Processing (processing.org) 创建一个程序。该程序将涉及绘制大量二维数据的图形。我希望显示的点填满窗口。我查看了他们的库,但没有看到任何数据可视化的内容。我错过了什么吗?
I'm looking at creating a program with Processing (processing.org) in Java. The program will involve graphing a large amount of 2D data. I would like for the points to be displayed to fill the window. I've looked at their libraries and I don't see anything for data visualization. Am I missing something?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
JUNG 是我的最爱。
JUNG Is a favorite of mine.
处理确实非常强大,考虑到您可以非常接近实际的图形编程,可以将其视为“原始”语言。我自己创建了很多图表,可以告诉您在使用这个库时必须非常小心。这很棒,但你必须从头开始做所有事情。这意味着为 x 和 y 轴创建线条、创建标签、创建空间等。
我的建议是设置您最有可能拥有的点数,例如 1000,并始终显示那么多数据。如果您的数据太少或太多,只需在将其发送到图表之前进行调整即可。这样你就永远有一个固定的数字。从这里开始,您要做的事情如下:
这将在一次绘图操作中创建所有线条,这意味着您将保存大量打开和关闭形状。您还可以使用堆栈矩阵来使用缩放操作来调整画布的显示大小。其他一切都取决于你。希望有帮助。
Processing is really powerful and can be considered a "raw" language given how close you can get to actual graphic programming. I've myself created many graphs and can tell you that you have to be very careful when using this library. It's great but you have to do everything from scratch. This means creating lines for the x and y axis, creating your labels, creating the space, etc.
My suggestion is to set the number of points you'll most likely have, say 1000, and always display with that much data. If you have too little or too much, just adjust it before sending it to graph. This way you'll always have a set number. From here what you do is the following:
This will create all your lines in a single drawing operation meaning you'll save a lot of opening and closing shapes. You are also using a stack matrix to use the scale operation to adjust the displaying size of your canvas. Everything else is up to you. Hope that helps.
我一直使用 JFreechart 或者,将更复杂的图形导出到文本文件,然后 gnuplot。
I've always used JFreechart or, for more complex graphing exporting to a text flie and then gnuplot.
另一次投票给 JFreeChart。尽管对于更复杂的图形,我已经编写了自己的(AWT)。
another vote for JFreeChart. Although for more complex graphing I've written my own (AWT).