tags:

views:

469

answers:

4
+2  Q: 

gnuplot labels

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?

A: 

I checked the documentation and I don't see a way to do it automatically, but you can manually set a title with

plot "file.txt" using 1:2 title "A" with lines smooth bezier ...
David Zaslavsky
A: 

I once wrote a script to plot FM radio station frequencies along an axis from 87MHz to 108MHz, using the names of each radio station as vertical labels. This was not a pure gnuplot solution, the input file is processed with perl with make, but I suggest you have a look at it and see if you can use something like that.

hlovdal
A: 

You could also use a gnuplot toolkit such as this one for Python if you want have a lot of data to plot and you want to automate the extraction of the titles.

marcog
+2  A: 
set key autotitle columnhead
Svante