If you double space your data file you can achieve this using index
. You can use awk
within gnuplot
to do the spacing on the fly:
splot for [i=0:system("wc -l < data")] '<awk -v s="\n" "{print s}1" data' using (0):(0):(0):1:2:3 index i notitle with vectors
The system
command counts the number of lines in the file. awk
prints two newlines for every line in the data file, so each line has a separate index
. I have used a variable containing the \n
character as this avoids difficulties in escaping strings.
edit
There's no need for any of that awk
. You can use stats
to get the number of lines in your file and every
to plot each line separately:
stats 'data' nooutput
splot for [i=0:STATS_records] "data" using (0):(0):(0):1:2:3 every ::i::i with vectors notitle