Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

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?

like image 551
user1535776 Avatar asked Feb 07 '13 01:02

user1535776


People also ask

How use gnuplot to plot data from a file?

To plot functions simply type: plot [function] at the gnuplot> prompt. Discrete data contained in a file can be displayed by specifying the name of the data file (enclosed in quotes) on the plot or splot command line. Data files should have the data arranged in columns of numbers.

How the plot generated by gnuplot may be saved in a file?

There are two ways to save your work in gnuplot: you can save the gnuplot commands used to generate a plot, so that you can regenerate the plot at a later time. Or you can export the graph to a file in a standard graphics file format, so that you can print it or include it in web pages, documents, or presentations.

What is Multiplot gnuplot?

The command set multiplot places gnuplot in the multiplot mode, in which several plots are placed on the same page, window, or screen.

What is gnuplot Splot?

splot is the command for drawing 3-d plots (well, actually projections on a 2-d surface, but you knew that). It can create a plot from functions or a data file in a manner very similar to the plot command. See plot (p. ) for features common to the plot (p. ) command; only differences are discussed in detail here.


1 Answers

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.

like image 108
mgilson Avatar answered Oct 12 '22 13:10

mgilson