Usefull commmands for GNUPLOT
For a more thorough review of the GNUPLOT program use either of theese links to the short or the long guide. To look at a graph of you data-file:plot "FILENAME.txt"To draw a line between the meassured points, not placing the dots:
plot "FILENAME.txt" w lTo specify which columns, X and Y, of data to use:
plot "FILENAME.txt" using X:YUncertainty
If you've calculated or in some other way know the uncertainty of your meassurements, use the following to have GNO-plot depict errorbars in the graph, create three columns of data, X,Y,Z:
plot "FILENAME.txt" using X:Y:Z w eFitting a function to meassurements
f(x)= a*x+b
fit f(x) "FILENAME.txt" via a,b using X:Y:Z w e
This would fit a straight line to the specified points (X,Y) with the uncertainties listed in Z.Layout on the graph By using the following pieces of code, you can name the axes ect.:
set xlabel "NAME"
set ylabel "NAME"
replot
Saving the GNU-plot-files
The following code will save the plot as .eps-files:
set terminal postscript eps enh col
set output "NEW_FILEMANE.eps"
rep
! gv FILENAME.eps &
The last line will open the file you created to view. Printing praphs When the graphs have been saved in a suitable filetype, use the following command in the terminal (e.g. not in th GNU-plot-window):
lpr -P PRINTERNAME "FILENAME.FILETYPE"Back to Physics-LAB-Course