I am using a gnuplot plot loop to plot data from several plots together:
filenames = "my data files"
plot for file in filenames file.".txt" \
title file
Right now I'm using title file to set the plot title, but I'd like more control over the plot title without resorting to changing my file names. For example, in pseduocode, I'd like:
files = [first, second, third, fourth]
titles = [One title, second title, third title, fourth title]
plot for [n=1:4] files[n] titles[n]
Note that the titles consist of multiple words, so words(titles,n) is not an option.
Is there another method I can use to give me more flexibility in my titles?
sprintf()command known from C. But if you have filenames, only, there's not much you can do. But if your filenames contain a series of numbers, you can use something likeplot for [i=1:10] sprintf("file%d.txt", i) title sprintf("Dataset %d",i)