I found many solutions to this question for GNUPlot 4.2+ using title column, columheader etc. However, I am stuck with GNUPlot 4.0 and need to find a way to automatically set the titles using the top row of my data set.
I’m using a bash script to generate a dynamic (-> changes daily) file with data and I have a static .gnu file that contains the gnuplot settings.
Do you have any suggestions?
(Perhaps a way to use a variable/array inside the .gnu file?)
The trick is using the Command Substitution
Sample Code:
Note:
$(head -1 data.txt)expand toheaderbefore passing to Gnuplot.