Java plotting/graphing libraries

I was looking for a Java plotting/graphing library to do some of the hard work in my new GA optimisation piece. I came across JFreeChart. While I haven’t used it yet, I was sufficiently impressed with the examples on their site that I had to post the link. So here it is: http://www.jfree.org/index.html.

I’ll be sure to add to this post when I’ve had a little time working with it.

~ 1 hour later ~

Ok, I’m back.

Download 2 things: the library jfreechart-1.0.13.zip, and the dependency jcommon-1.0.16.tar.gz. They’re both on sourceforge. Extract them wherever you keep your user java libraries (eg ~/JavaProjects/Lib/).

Now build the javadoc documentation for each of these two libraries. This means jumping into the terminal and running “ant javadoc” from inside each of the ant directories: ~/JavaProjects/Lib/jfreechart-1.0.13/ant, and ~/JavaProjects/Lib/jcommon-1.0.16/ant. You should see new javadoc directories under jfreechart-1.0.13 and jcommon-1.0.16.

You should also get your hands on the guide jfreechart-1.0.13-install.pdf, which contains detailed instructions about configuring the eclipse IDE (which is what I use) to use these libraries. Basically you need to add two user libraries… jfreechart and jcommon… and for each you specify three things… the jar file, the source directory, and the javadoc directory. I suspect only the jar is critical here, and that the others are used to help debugging. Their guide (jfreechart-1.0.13-install.pdf) also contains a walkthrough for creating a project that uses jfreechart to produce a pie chart.

But pie charts are about as good at being charts as they are at being pies. jfreechart-1.0.13-install.pdf contains a number of more exciting examples, including a scatter plot (fig 2.10) which refers to a source file ScatterPlotDemo1.java. These example sources (and additional documentation) are available from JFree for a price, but some can be found on Google.