How to plot several datasets with titles from one file in Gnuplot?

It’s definitely possible and your datafile is already the correct format. The functionality you’re looking for is built into columnheader(N) which reads the data at the top of the N’th column and uses it as the plot title:

 plot 'test.dat' i 0 u 1:2 w lines title columnheader(1),\
      'test.dat' i 1 u 1:2 w lines title columnheader(1)

which can be condensed using iteration:

plot for [IDX=0:1] 'test.dat' i IDX u 1:2 w lines title columnheader(1)

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)