How to treat the first line of the data file as column labels in gnuplot?

Verhogen picture Verhogen · Apr 21, 2009 · Viewed 17.8k times · Source

I have a table like this:

A B C D E F G H I 
10 23998 16755 27656 17659 19708 20328 19377 18925
20 37298 33368 53936 41421 44548 40756 40985 37294

I use this command to plot

plot "C:/file.txt" using 1:2 with lines smooth bezier, "C:/file.txt" using 1:3 with lines smooth bezier, ...

However, all the labels come out as the file name. Is it possible for gnuplot to read the first row and label the lines accordingly?

Answer

Svante picture Svante · Apr 21, 2009
set key autotitle columnhead