so I want to plot from a data file which has an undetermined number of fields of x and y data (of unknown but constant length). I want to plot them all together on one graph
If you have gnuplot >= 4.6.0, you can use the stats
command:
#!/usr/bin/env gnuplot
reset
datafile = 'data.dat'
set terminal png size 600,400
set output 'test.png'
stats datafile
plot for [i=1:STATS_blocks] datafile index (i-1) pt 7 ps 2 title 'record '.i
If your data looks like this (with two blank lines separating the data blocks)
1 1
2 2
3 3
4 2
0 3
That script will make this plot:
The same should apply for blocks of data with more than one (x,y) pair.