Short Gnuplot guide
In the following you will find short instructions for the use of Gnuplot with a short overview of the most important commands to create 2D- and 3D-Plots.
You will find further information and help with Gnuplot here:
Onlinesoftware for automatic generation of Gnuplot-Scripts
- Starting of Gnuplot under UNIX:
- gnuplot
- Starting of Gnuplot under Windows:
- Start-Alle Programme-Data_Analysis-GnuPlot
- Exiting of Gnuplot:
- exit
- Help:
- help
- Setting of output terminal:
- set terminal (Liste der möglichen Einstellungen)
set terminal x11 (X-Windows-Ausgabe)
set terminal windows (Windows-Ausgabe)
set terminal postscript (Postscript-Ausgabe)
set terminal dumb (ASCII-Ausgabe)
set terminal table (Tabellen-Ausgabe)
- Visualization of content of an ASCII-File (x= first column, y= second column, other columns are ignored):
- plot "DATEINAME"
- Visualization of a function:
- plot FUNKTION(x)
z.B. plot cos(3*x+x**2)+x*exp(-x) - Combined output:
- plot "DATEINAME1", FUNKTION1(x), "DATEINAME2", "DATEINAME3", FUNKTION2(x),...
- Setting of x-Interval to be presented:
- plot [Xmin:Xmax] ...
- Setting of y-Interval to be presented:
- plot [] [Ymin:Ymax] ...
- Setting of both intervals:
- plot [Xmin:Xmax] [Ymin:Ymax] ...
- Output of data from other columns of a file:
- plot "DATEINAME" using xSpaltenNr:ySpaltenNr
- Output with y-errorbar:
- plot "DATEINAME" using xSpaltenNr:ySpaltenNr:FehlerSpaltenNr with errorbars
- Output with x- and y-errorbar (from version 3.6):
- plot "DATEINAME" using xSpaltenNr:ySpaltenNr:xFehlerSpaltenNr:yFehlerSpaltenNr with xyerrorbars
- Title of the picture:
- set title "TITLE"
- x-, y-axis labeling:
- set xlabel "XLABEL"
set ylabel "YLABEL"
- Logarithmic Scale:
- set log x
set log y
set log
- Lineare Scale:
- set nolog x
set nolog y
set nolog
- Postcript output of a file Name.ps:
- set output "NAME.ps"
set term postscript
plot ...
- Saving of all Settings (Creation of a "plotfile"):
- save 'Plotfile-Name'
- Calling up a "plotfile":
- load 'Plotfile-Name'
oder direkt von der Kommandozeile:
gnuplot 'Plotfile-Name' -
General Remarks
All commands can be reduced to the smallest unambiguous form
e.g. pl "x.dat" u 2:4:6 w e == plot "x.dat" using 2:4:6 with errorbars
Columns in files are separated by one or more spaces or tabs
Lines that start with "#" will be ignored (comment lines).
You can download Gnuplot for free here.