I want to add an offset to the data from a file which i want to plot using gnuplot. Suppose i want to add an offset of 0.001 to all the data values from file before i plot them . How can i do it in gnuplot without having to rewrite the data file with the offsets.
Thanks.
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.
Gnuplot can read binary data files. However, adequate information about details of the file format must be given on the command line or extracted from the file itself for a supported binary filetype. In particular, there are two structures for binary files, a matrix binary format and a general binary format.
gnuplot is a not-quite-as-easy-to use, though extremely powerful, command-line plotting program. Running gnuplot is easy: from a command prompt on any system, type gnuplot. It is even possible to do this over a telnet or ssh connection, and preview the graphs in text mode!
Try something like this:
plot "Data.dat" u ($1):($2 + 0.001) w l
The $1
and $2
specify the column you want to plot. Simply add a constant like 0.001
to the column or even add two columns like so: $1 + $2
.
I hope that answers your quastion
Cherio Woltan
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