I have two files: one with x coordinates, and other with y.
Is there a way to plot this two files in one graph using gnuplot? Or is there a way to concat row by row this two files?
Thanks
5.9 Does gnuplot support multiple y-axes on a single plot? Yes.
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.
png, and svg terminal It exists also a png terminal, but it produces uglier output and doesn't use the UTF-8 encoding the cairo library does. You may also have noticed that we set the size to a given x,y value. If we don't do this, the default value of 640,480 is used.
Gnuplot is a portable command-line driven graphing utility for Linux and other OS. C and Gnuplot can be used to plot complex functions. One can write the function in C and then write the values of the function at various values in a txt file, which can then be plotted using Gnuplot.
There is not a way to plot the x coordinate from one file and the y coordinate from another natively in gnuplot.
If you use a bash-like shell, you can use the command
paste x_data.dat y_data.dat > xy_data.dat
to combine files row-by row. If you want to put this command into a gnuplot script, you can do so like this:
plot "<paste x_data.dat y_data.dat"
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