Naming the legend entry in Gnuplot, while plotting from a data file

user1535776 picture user1535776 · Feb 7, 2013 · Viewed 33.6k times · Source

I am plotting a data file with six columns in gnuplot. If the plot of column 2 against column 1 is x(t), I want that line in the legend something like x(t), NOT what I currently get for column two against column one, "trial.dat" u 1:2.

How would I name the legend line, then?

Answer

mgilson picture mgilson · Feb 7, 2013

You use the title keyword in the plot line:

plot 'trial.dat' u 1:2 title "x(t)"

You can also get rid of the legend entry all together by using notitle.