As noted by Christoph, you need to transpose the data before plotting, the answers here should be helpful with that. To determine the number of rows in the data, recent versions of Gnuplot can use the stats
command (see comment by Christoph below), otherwise the number of lines needs to be counted by other means.
Here is how you could handle both issues with external programs:
dfile = "data.csv"
nrec = system("wc -l < " . dfile)
set datafile separator ';'
plot for [i=2:nrec] '<transpose --fsep \; -t '.dfile using i:xtic(1) with lines title columnhead
I used wc
from coreutils to count the number of lines and transpose
as suggested by flyingsheep to handle the transposition.
Result:
Running the same script on data with more plots and data points:
data2.csv
name;n0;n1;n2;n3;n4
Benj;1;3;2;5;3
Silv;6;1;2;3;4
Steffi;3;2;2;4;2
Carl;2;4;5;3;2