GNU Plot
GNU Plot
Quick Guide
ELECTGON
www.electgon.com
[email protected]
21.06.2018
Contents
1 Installing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2 Launch Gnuplot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
3 Plotting Data From File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Gnuplot 1. Installing
1 Installing
Install gnuplot in linux using
$sudo apt-get install gnuplot
the following package is also needed to display output graphs
$sudo apt-get install gnuplot-x11
2 Launch Gnuplot
In terminal window type gnuplot. There are some de ined functions in gnuplot that you can
work with directly.
Function Returns
abs(x) absolute value of x, |x|
acos(x) arc‐cosine of x
asin(x) arc‐sine of x
atan(x) arc‐tangent of x
cos(x) cosine of x, x is in radians.
cosh(x) hyperbolic cosine of x, x is in radians
erf(x) error function of x
exp(x) exponential function of x, base e
inverf(x) inverse error function of x
invnorm(x) inverse normal distribution of x
log(x) log of x, base e
log10(x) log of x, base 10
norm(x) normal Gaussian distribution function
rand(x) pseudo‐random number generator
sgn(x) 1 if x > 0, ‐1 if x < 0, 0 if x=0
sin(x) sine of x, x is in radians
sinh(x) hyperbolic sine of x, x is in radians
sqrt(x) the square root of x
tan(x) tangent of x, x is in radians
tanh(x) hyperbolic tangent of x, x is in radians
Bessel, gamma, ibeta, igamma, and lgamma
functions are also supported. Many functions
can take complex arguments. Binary and unary
operators are also supported.
So you can use any of these functions to make operations or to plot it.
$gnuplot> plot sin(x)/x
this will plot sin(x)/x with x has default range values [‐5:5] to draw for another range type
$gnuplot> plot [-15:15] sin(x)/x
you can control range of display graph by de ining it as:
3
Gnuplot 3. Plotting Data From File
$gnuplot> set xrange [0:5]
$gnuplot> set yrange [-1:1]
$gnuplot> replot
1 30
2 35
3 40
4 45
5 50
6 55
7 60
8 65
9 70
10 75
11 80
12 85
4
Gnuplot 3. Plotting Data From File
5
Bibliography
[1] http://people.duke.edu/~hpgavin/gnuplot.html
[2] https://web.archive.org/web/20121029110317/http://t16web.lanl.gov/Kawano/gnuplot
/index‐e.html