Graphics data with Java processing

I'm looking to create a program with processing (processing.org) in Java. The program will include a graphical display of a large amount of 2D data. I would like the dots to be displayed to fill the window. I've looked through their libraries and I can't see anything for data visualization. Did I miss something?

+2


source to share


4 answers


I have always used JFreechart or for more complex graphical display exporting to a text checkbox and then gnuplot .



+1


source


another vote for JFreeChart. Although for a more complex graph, I wrote my own (AWT).



0


source


JUNG I'm one of the favorites.

0


source


The processing is really powerful and can be considered a "raw" language considering how close you can get to actual graphical programming. I have created many plots myself and I can tell you that you have to be very careful when using this library. This is great, but you have to do everything from scratch. This means creating lines for the x and y axis, creating your labels, creating space, etc.

My suggestion is to set the number of points you are most likely to have, say 1000, and always display with that amount of data. If you have too little or too much, just adjust it before sending it to the chart. This way you will always have a given number. From here, you do 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 of your lines in one draw operation, which means that you will save many opening and closing shapes. You also use a stack matrix to use the scaling operation to adjust the display size of your canvas. The rest is up to you. Hope it helps.

0


source







All Articles