I have CSV file with the following structure:
headerString1;headerString2;...;headerStringN
doubleNumber1;doubleNumber2;...;doubleNumberN
... many other doubleNumberRows
I want to plot histograms from each of the columns in individual files - this is something that works - and I want to take the title for each individual plot from the CSV-file, first row. I searched a lot, but could find a solution. Up to now this is my gnuplot code:
set datafile separator ";"
set style data histogram
binwidth=20
set boxwidth binwidth-2
bin(x,width)=width*floor(x/width)
# No legends!
unset key
do for [COL=1:10] {
set title sprintf("%d", columnheader(COL)) <--- This always tells me it is a number, "%s" does not work
FILE = sprintf("%s%02d%s","Histogram",COL,".png")
set term png giant font helvetica 24 size 1440, 1080
set output FILE
plot "myCSVFile.CSV" using (bin(column(COL),binwidth)):(1.0) smooth freq with boxes lc 1
}
columnheader(COL) is a number (?), at least I can convert it via sprintf("%d", columnheader(COL)) to a number string which is "-2147483648" for all plots. The output looks like this:
How do I retrieve the headerString# strings and use it as title in my individual plot?