My question is very simple. Suppose I have a datafile with column headers, like as follows
first second
1 1
2 1
3 6
4 9
In gnuplot how do
To elaborate the suggestion of @andyras, here is how you can do it:
datafile = 'filename.txt'
firstrow = system('head -1 '.datafile)
set xlabel word(firstrow, 1)
set ylabel word(firstrow, 2)
plot datafile using 1:2
You must plot with the explicit using statement, otherwise gnuplot will complain about bad data on line 1.