1
votes

I am using gnuplot 5.0, and I have a data set I would like to plot using

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)

This is not working, but I would like to have a different string with multiple words for each curve. Using words() and word() will not work. So, how can I change the title in a plot-for command?

1

1 Answers

0
votes

Gnuplot 5.0 introduces some limited support for using quoted strings with word and words:

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)

enter image description here