I'm using C++ to plot graphs using Gnuplot. In the C++ program, I popen() a Gnuplot process file, and keep writing to it to plot my graphs. Specifically, I write "plot '-' using 1:2 with points", and then continue with writing the X-Y coordinates. For just two columns, it works fine.
Now I have modified my program to generate more than 2 columns. I now have data in the following format
X, Y1, Y2, Y3, Y4, Y5
So every second, it outputs one line (for example "1 2 3 4 5 6", where 1 is the X coordinate, and the rest of the values are Y coordinates for different curves). I cannot figure out how to fit all the curves in one single window.
If I do something like the following,
set xrange[0:5]
set yrange[0:10]
plot '-' using 1:2 with lines, '-' using 1:3 with lines
1 2 3
2 3 4
3 4 5
4 5 6
5 6 7
it gives me an error which says
"warning: Skipping data file with no valid points"
and also requires pressing "e" twice to indicate the end of data.
Maybe I'm missing something tiny here.
Thanks!