2

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?

2
  • What is 'the points to be displayed to fill the window'? If you want to draw a point, there's function called point() -- processing.org/reference/point_.html If you want to fill the window, you can specify background with background() -- processing.org/reference/background_.html Commented Sep 23, 2009 at 13:35
  • 1
    I think the idea with Processing is for you to use the tools they already have to visualize your data. So you use properties of the data you are working with to set location, size, shape, color, etc. of items in your sketch. It's meant to be a rather creative process as far as I understand it, rather than you just throwing your data at an API call...or am I misunderstanding your question? Commented Sep 28, 2009 at 19:16

4 Answers 4

1

I've always used JFreechart or, for more complex graphing exporting to a text flie and then gnuplot.

Sign up to request clarification or add additional context in comments.

Comments

0

another vote for JFreeChart. Although for more complex graphing I've written my own (AWT).

Comments

0

JUNG Is a favorite of mine.

Comments

0

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:

pushMatrix();
scale(widthOfGraph/1000, heightOfGraph/numberOfPointsUp);
beginShape(LINES);
for (int i = 0; i < 1000; i++) {
    vertex(x0,y0);
    vertex(x1,y1);
endShape();
popMatrix();

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.