I have a Java program which starts GNUPlot.
Runtime.getRuntime().exec("gnuplot");
Java communicates with it over the output stream. Now I'm creating lots of different terminals with different plots.
set term wxt [terminalId]
The plot command for the different terminals consists of function plotting and plotting of data points (so the plot command is like "plot sin(x), cos(x), '-';" ). The data points are sent in this format:
0 0;
1 1;
2 2;
3 3;
e;
I'm trying to export the finished plots to PNG (or a different image format).
for(int terminalId = 0; terminalId < lastTerminalId; terminalId++) {
gnuPlotter.sendCommand("set term pngcairo size " + width + "," + height + ";");
gnuPlotter.sendCommand("set output 'terminal" + terminalId + ".png';");
gnuPlotter.sendCommand("replot;");
}
My problem is that my data points aren't replotted. I think replot is really only sending the "plot ..." command again, but isn't repeating the listing of data point which should be send afterwards. How can I plot exactly what's already on the WXT terminals on the PNG terminal again?