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?
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.
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.
The command set multiplot places gnuplot in the multiplot mode, in which several plots are placed on the same page, window, or screen.
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.
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
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With