在循环中更改标题

Changing title within loop

我正在使用 gnuplot 5.0,并且我有一个数据集,我想使用

进行绘图
key1 = 'Some title with multiple words'
key2 = 'Some other descriptive title '
key3 = '...and a third title'
plot for[i=1:3] datafile index i-1 using 1:2 with lines title eval('key'.i)

这行不通,但我想为每条曲线设置一个包含多个单词的不同字符串。使用 words()word() 将不起作用。那么,如何更改 plot-for 命令中的标题?

Gnuplot 5.0 引入了一些对 wordwords:

使用引号字符串的有限支持
keys = '"Some title with multiple words" '.\
       '"Some other descriptive title" '.\
       '"...and a third title"'
plot for[i=1:3] i*x with lines title word(keys, i)