Skip to content

Gnuplot Java API

Ciaran O'Reilly edited this page Jun 3, 2015 · 2 revisions

Gnuplot Java API

Gnuplot is free, open-source software for plotting mathematical graphs. This library provides a Java API for using Gnuplot.

Here is an example of its usage:

plot(
        Util.list( // precommands
                        "persist",
                        "set term postscript color",
                        "set output 'test.ps'",
                        "set xlabel 'Time'",
                        "set ylabel 'Intensity'"
        ),
        Util.getIteratorNullaryFunction(Util.list(10,20,30,40)), // xSeries
        Util.list( // list of ySeries
                        new DataSeries<Integer>(
                                        Util.list("title 'random sequence 1'", "w linespoints"),
                                        Util.list(1,2,4,3)
                                        ),
                        new DataSeries<Integer>(
                                        Util.list("title 'random sequence 2'", "w linespoints"),
                                        Util.list(5,4,3,2)
                                        )
                        )
        );

Please see Javadoc for more details.