SlideShare a Scribd company logo
‘ GNUPLOT & ITS APPLICATIONS’
Sabyasachi Ray
Roll no.03 , Part 2
Department of physics
University of North Bengal
 Scientists runs simulations or take
measurements. These data need to be
presented in an appealing and professional
manner.
 Sometimes there are a lot of data. Sometimes
it is difficult to make the interesting features
come out right. Sometimes many plots must
be produced.
 Manually doing plot with indefinitely large no.
of data are very difficult job. These
different necessity of plotting insists people
to develop some way to save time as well
as hard working.
GNUPLOT: a SOLUTION
 There are lots of other plotting tools available
for creating 1D or 2D plots from numerical
data in different operating systems
 Though many plotting tools are available now-
a-days , one of the best advantages of ‘gnuplot’
over (say) MATHEMATICA or MAPLE GRAPHS is
that it is incredibly easy to write scripts to
automatically create graphs for people from
raw data.
What is gnuplot?
 gnuplot is a command-driven interactive function
and data plotting program. It can be used to plot
functions and data points in both two and three
dimensional plots in many different formats.
GNUPLOT : HISTORY
 Software developer:
Original software:
THOMAS WILLIAMS,COLIN KELLEY
gnuplot 2.0 additions:
RUSSELL LANG, DAVID KOTZ, JOHN CAMPBELL
gnuplot 3.0 additions:
GERSHON ELBER,ALEXANDER WOO & MANY
OTHERS
gnuplot 4.0 additions:
HANS-BERNHARD BRӦKER, ETHANA-MERIT AND
OTHERS
GNUPLOT: supporting
operating system
 precompiled executables and source code for
gnuplot is downloadable for
1) windows ,
2) DOS,
3) Unix,
4) Linux.
Gnuplot is preinstalled in most of the LINUX
system
LINUX
 ‘gnuplot’ is a software works in almost every
platform. I do my PROJECT WORK in
FEDORACORE 3 (LINUX) platform. As scientific
world mostly uses the LINUX platform.
WORLD-WIDE LINUX
 The governments of many third world nations
like BRAZIL, SPAIN,CHINA,PERU,PAKISTAN and
INDIA are actively involved in promoting
LINUX and associate open source softwares.
 LINUX has found its way to Cell-Phones,
desktops and office computers.
 the LHC itself is controlled by LINUX
Installing Fedora:requirement
 A pentium-class PC (at least 200 MHz for text mode;
400 MHz Pentium II for GUI)
 64 Mb RAM (for text mode)
 192 Mb RAM (for GUI mode)
Minimum hard-disk space
620Mb for minimum custom install
2.3 Gb for personal desktop
3.0 Gb for workstation
1.1 Gb for server install
A everything install requires at least
6.9Gb
Linux: installation
 I installed fedora core 3 in a desktop.
 There are different steps one should follow while
installing.
 The important thing is the PARTITION of hard drive.
Linux: installation
 I choose …
 DISK PARTITION
 MANUALLY⤶
 /boot=100 Mb
 /swap=996 Mb
 /home=10001 Mb
 / =10001 Mb
 free==1961 Kb
Plotting:What does gnuplot offer?
 Plotting two-dimensional functions and data points in
many different styles (points, lines, error bars)
 Plotting three-dimensional data points and surfaces in
many different styles (contour plot)
 Algebraic computation in integer, float and complex
arithmetic
 User-defined functions
 Support for a large number of operating systems, graphics
file formats and output devices
 Extensive on-line help
 TEX-like text formatting for labels, titles, axes, data
points
 Interactive command line editing and history .
Starting : GNUPLOT
 To start gnuplot in LINUX we have to simply type
gnuplot in the command line of the linux terminal as
follows:
 gnuplot
 This command gives:
Starting : GNUPLOT
G N U P L O T
Version 4.0 patchlevel 0
last modified Thu Apr 15 14:44:22 CEST 2004
System: Linux 2.4.23
Copyright (C) 1986 - 1993, 1998, 2004
Thomas Williams, Colin Kelley and many others
This is gnuplot version 4.0. Please refer to the documentation
for command syntax changes. The old syntax will be accepted
throughout the 4.0 series, but all save files use the new syntax.
Type `help` to access the on-line reference manual.
The gnuplot FAQ is available from
http://www.gnuplot.info/faq/
Send comments and requests for help to
<gnuplot-info@lists.sourceforge.net>
Send bugs, suggestions and mods to
<gnuplot-bugs@lists.sourceforge.net>
Terminal type set to 'x11'
gnuplot>
Starting : GNUPLOT
Now gnuplot is ready to
perform different commands
that it supports
Gnuplot: functions
 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
Gnuplot: functions
 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
 E.T.C.
Gnuplot: as calculator
 gnuplot> print abs({3,4})
 5.0
 gnuplot> print log(100)
 4.60517
 gnuplot> print log10(100)
 2.0
 gnuplot> print rand(100)
 0.13348
Gnuplot: as calculator
 gnuplot> print sqrt(100)
 10.0
 gnuplot> print gamma(4)
 6.0
 gnuplot> print 3!
 6.0
 Like that
Gnuplot: as calculator
gnuplot> print 1/3
0
 How strange!!!
Gnuplot: as calculator
Gnuplot does integer,
and not floating point,
arithmetic on integer
expressions
gnuplot> print 1./3.
0.333333
gnuplot: plotting applications
 the primary commands in Gnuplot:-
 plot -2D
 splot -3D
 replot.
Gnuplot: plotting functions
 To plot functions simply one have to type: plot
[function] at the gnuplot> prompt.
 say plot sin(x) to draw a first figure.
 Say replot sin(x)**2 to add a second plot
 Say plot sin(x),-sin(x) to plot two graphs at once.
 Also one can define external function as
gnuplot> f(x)=3*x**4
gnuplot> plot f(x)
Gnuplot: plotting functions
 gnuplot> plot sin(x)
Gnuplot: plotting functions
gnuplot> replot sin(x)**2
Gnuplot: plotting functions
gnuplot> f(x)=3*x**4
gnuplot> plot f(x)
Gnuplot: plotting functions
 gnuplot> splot sin(x*y/20)
gnuplot: Plotting data
 For example my data file, force.dat , might look like:
 0.000 0 0
 0.001 104 51
 0.002 202 101
 0.003 298 148
 0.0031 290 149
 0.004 289 201
 0.0041 291 209
 0.005 310 250
 0.010 311 260
 0.020 280 240
gnuplot: Plotting data
 One can display plot data by typing:
 gnuplot> plot "force.dat" using 1:2 title 'Column', 
"force.dat" using 1:3 title 'Beam’
 If the data are in multiple data files. In this case
one should plot by using a command like:
 gnuplot> plot "fileA.dat" using 1:2 title 'data A', 
"fileB.dat" using 1:3 title 'data B'
gnuplot: plot command
customization
 Plots may be displayed in one of the styles: lines,
points, linespoints, impulses, dots, steps, fsteps,
histeps, errorbars, xerrorbars, yerrorbars,
xyerrorbars, boxes, boxerrorbars, boxxyerrorbars,
financebars, candlesticks or vector To specify the
line/point style use the plot command as follows:

 gnuplot> plot "force.dat" using 1:2 title 'Column'
with lines,
"force.dat" u 1:3 t 'Beam' w linespoints
gnuplot: PRINTING
 One can create a PostScript file of plot by using
the following :
 gnuplot> set terminal postscript
 gnuplot> set output "my-plot.ps"
 gnuplot> plot sin(x)
gnuplot: Commands to Quit
 exit or quit command terminates gnuplot.
 Once one quit gnuplot, all of setting one made
will be lost.
 To save the current setting, use save command
followed by a file name in which parameters and
functions one defined are stored.
 gnuplot overwrites internal parameters in that
file without any warnings.
gnuplot: Commands to Save
Parameters
 gnuplot> save "savefile.plt"
 the saved file is a usual text file.
 one can edit the contents with a text editor.
 To draw a graph again with this file, we use the
load "savefile.plt" command at the gnuplot
command-line-
 gnuplot> load "savefile.plt"
application: gnuplot
 Now different kind of plotting and fitting that
I made are shown and explained in the next
coming slides.
simple ploting using sin(x)
 gnuplot> set terminal postscript
 gnuplot> set output 'sin.pdf'
 gnuplot> plot sin(x)
simple ploting using sin(x)
 To set the X range 0 to 5, [0:5]
 gnuplot> plot [0:5] sin(x)
simple ploting using sin(x)
 gnuplot> set angle degree
 gnuplot> set xrange[-270:270]
 gnuplot> plot sin(x)
 gnuplot> set xrange [-2*pi:2*pi]
 gnuplot> a=0.5
 gnuplot> plot a*sin(x)
gnuplot: different styles available
 Now say some data file named "output.dat"
contains some nature as shown below.
 gnuplot> plot "output.dat" title ‘style1’ with lines.
gnuplot: different styles available
 gnuplot> plot "output.dat" title ‘style2’ with points
gnuplot: customizing styles
 gnuplot> plot "output.dat" title ‘style3’ with steps.
gnuplot: customizing styles
 gnuplot> plot "output.dat" title ‘style4’ with impulses
gnuplot: plotting of two sets of
data from a single data file
 The taken data file was named ‘ lateral density.txt’
 #lateral density.txt
 gnuplot> set terminal postscript
 gnuplot> set output 'lateral density.pdf'
 gnuplot> set logscale
gnuplot: plotting of two sets of
data from a single data file
 gnuplot> set title 'PLOTTING OF TWO SETS OF
DATA FROM A DATA FILE‘
 gnuplot> set xrange [8:75]
 gnuplot> set yrange [0.1:3.0]
 gnuplot> set xlabel 'CORE DISTANCE(meter)'
 gnuplot> set ylabel 'DENSITY (particle/square meter)'
 gnuplot> plot 'lateral density.txt' u 1:3 title
'experimental density' w p 3,
 > 'lateral density.txt' u 1:2 title 'theoretical density' w p
4
gnuplot: plotting of two sets of
data from a single data file
gnuplot: plotting of two sets of
data from a single data file
 gnuplot> replot 'lateral density.txt' u 1:2 w l title
'theoretical graph‘
gnuplot: plotting of two sets of
data from two different data
files and comparing them
 two data file are ‘absorptionrade’ & ‘absorptionsr’
 gnuplot> set terminal postscript
Terminal type set to 'postscript'
Options are 'landscape noenhanced monochrome blacktext 
dashed dashlength 1.0 linewidth 1.0 defaultplex 
palfuncparam 2000,0.003 
butt "Helvetica" 14'
 gnuplot> unset logscale
 gnuplot> set output 'absorption plot.ps'
 gnuplot> set xlabel 'Corrected thickness (mg/cm^2)'
 gnuplot> set ylabel 'counts/minute'
 gnuplot> set title'BETA ABSORPTION CURVE'
gnuplot: plotting of two sets of
data from two different data
files and comparing them
 gnuplot> plot 'absorptionrade' w p 3,'absorptionsr'
title'comparing two sources'
gnuplot: linear curve fitting
 The data file that I choose for this case is:
 Age.txt
 gnuplot> set output 'age.ps'
 gnuplot> set title 'LINEAR CURVE FITTING FOR
DATA FILE USING GNUPLOT'
 gnuplot> set label 'z=zenith angle' at 1.1 ,1.6
gnuplot: linear curve fitting
 gnuplot> set xrange[1:1.5]
 gnuplot> set yrange[1.25:1.65]
 gnuplot> set xlabel 'sec(z)'
 gnuplot> set ylabel 'SHOWER AGE'
 gnuplot> f(x)=(m*x)+c
 gnuplot> m=1.4;c=-0.13
 gnuplot> fit f(x) 'age.txt' u 1:2 via m,c
 After 4 iterations the fit converged.and it is
shown on the screen
gnuplot: linear curve fitting
 gnuplot> set label 'f(x)=m*x+c,m=0.98,c=o.30' at 1.3,1.5
 gnuplot> plot 'age.txt' u 1:2:3 w yerrorbars title
'f(x)=m*x+c',
 > f(x) title 'fitted curve‘
these commands will produce :
Project gnuplot
linear curve fitting of more than
one plot in a single graph:
 My data file is ‘test.txt’ that I used in my this
particular plotting:
 gnuplot> set terminal postscript
 gnuplot> set output 'manyplot.ps'
 gnuplot> set title ' PLOTING & LINEAR FITTING OF
MORE THAN ONE DATA SETS AT A TIME'
 gnuplot> set xlabel 'sec(z)'
 gnuplot> set ylabel 'shower age'
 gnuplot> set label 'z is the zenith angle' at 1.1,1.5
 gnuplot> set xrange[1:1.4]
 gnuplot> set yrange [1:1.55]
 gnuplot> f1(x)=a1*x+b1
 gnuplot> a1=-2;b1=3.28
 gnuplot> fit f1(x) 'test.txt' u 1:2 via a1,b1
 the fitting command for 2nd set of data points
are:
 gnuplot> f2(x)=a2*x+b2
 gnuplot> a2=0.067;b2=1.173
 gnuplot> fit f2(x) 'test.txt' u 1:4 via a2,b2
 the fitting command for 3rd set of data points
are:
 gnuplot> f3(x)=a3*x+b3
 gnuplot> a3=2;b3=-1.17
 gnuplot> fit f3(x) 'test.txt' u 1:6 via a3,b3
linear curve fitting of more than
one plot in a single graph:
 gnuplot> plot 'test.txt' u 1:2:3 w yerrorbars title' Fe',
 > f1(x) title 'y=0.31*x+0.95',
 > 'test.txt' u 1:4:5 w yerrorbars title ' Mixed',
 > f2(x) title 'y=0.17*x+1.07',
 > 'test.txt' u 1:6:7 w yerrorbars title ' proton',
 > f3(x) title 'y=.26*x+.83'
 These produce:
Project gnuplot
non-linear curve fitting
 For non-linear curve fitting I take the data file
'lateral density.txt'
 gnuplot> set output 'nonlinear.ps'
 gnuplot> set logscale
 gnuplot> set xrange [8:75]
 gnuplot> set yrange [0.1:3.0]
 gnuplot> set xlabel 'CORE DISTANCE(meter)'
 gnuplot> set ylabel 'DENSITY (particle/square meter)'
 gnuplot> set title 'NON-LINEAR FITTING (more than
one line)'
 gnuplot> set label 'y=(a+b*x+c*x**2+d*x**3)**3' at 30,1
non-linear curve fitting
 gnuplot> f1(x)=(a1+b1*x+c1*x**2+d1*x**3)**3
 gnuplot> a1=10;b1=20;c1=-4;d1=6;
 gnuplot> fit f1(x) 'lateral density.txt' u 1:2 via a1,b1,c1,d1
 gnuplot> f2(x)=(a2+b2*x+c2*x**2+d2*x**3)**3
 gnuplot> a2=1;b2=20;c2=-4;d2=6
 gnuplot> fit f2(x) 'lateral density.txt' u 1:3 via
a2,b2,c2,d2
non-linear curve fitting
 gnuplot> plot 'lateral density.txt' u 1:2 title 'theoretical' ,
 > f1(x) title 'a=1.77,b=-0.05,c=0.0011,d=-8.39e-6' ,
 > 'lateral density.txt' u 1:3 title 'experimental' ,
 > f2(x) title 'a=1.81,b=-0.06,c=0.001,d=-6.37e-6'
3-DIMENSIONAL PLOT USING
GNUPLOT:
 gnuplot> set output '3d.ps'
 gnuplot> set title 'the function choosen is sin(x*y/20)'
 gnuplot> set xr [-10:10]
 gnuplot> set yr [-10:10]
 gnuplot> set zr [-1:1]
 gnuplot> set xlabel 'x-axis'
 gnuplot> set ylabel 'y-axis'
 gnuplot> set zlabel 'z-axis'
 gnuplot> splot sin(x*y/20)
3-DIMENSIONAL PLOT USING
GNUPLOT:
The advantages
 The results are repeatable. This is very useful if one
needs many similar graphs, or if one potentially needs
to redo graphs with updated data.
 Plots can be produced automatically. Sometimes
plots take a long time, especially if there are much
data to be processed.
 Plots can be produced on a remote supercomputer,
written into a file, and then displayed locally. The data
do not need to be transferred.
 For a quick look at small datasets there are many
tools.
 For serious work gnuplot is one of the best.
Disadvantages
 Gnuplot has a limited set of line and point styles.
 Gnuplot cannot output symbolic equations or
formula and labels in most output formats.
 Gnuplot does a poor job of making contour plots.
 This is very hardworking job to remember all the
commands all time.
CONCLUSSION:
 In gnuplot there are many other integrated
facilities like animation. But due to shortage of
time I can not learn them.
 If I get an opportunity to use gnuplot in
future, this project will surely help me lot.
 More over I used this opportunity to learn little
bit about LINUX that would also help in advanced
studies.
Bibliography
 1> GNUPLOT 4.2 - A Brief Manual and Tutorial
Department of Civil and Environmental Engineering
Edmund T. Pratt School of Engineering
Duke University - Box 90287, Durham, NC 27708-0287
 2> www.gnuplot.info.
 3> G N U P L O T
 Version 4.0
 4> ‘fast track to LINUX, a beginners guide’ –digit February 2009.
 5> perfect Set up- Fedora Core 3 |HowtoForge-Linux Howtos and Tutorials
 www.howtoforge.com/perfect_setup_fedora_core_3
 6> book: BIBLE OF LINUX
 7> http://www.duke.edu/~hpgavin/gnuplot.html.
 8> http://www.cs.uni.edu/Help/gnuplot/
 9> Gnuplot Short Course- Tim Langlais

 10> http://t16web.lanl.gov/Kawano/gnuplot/index-e.html
THANK
YOU
Ad

More Related Content

What's hot (20)

Latex Notes
Latex NotesLatex Notes
Latex Notes
Sudhanshu Janwadkar
 
Image denoising algorithms
Image denoising algorithmsImage denoising algorithms
Image denoising algorithms
Mohammad Sunny
 
DESIGN AND ANALYSIS OF ALGORITHMS
DESIGN AND ANALYSIS OF ALGORITHMSDESIGN AND ANALYSIS OF ALGORITHMS
DESIGN AND ANALYSIS OF ALGORITHMS
Gayathri Gaayu
 
I. FSSP(Progression Planner) II. BSSP(Regression Planner
I. FSSP(Progression Planner) II. BSSP(Regression PlannerI. FSSP(Progression Planner) II. BSSP(Regression Planner
I. FSSP(Progression Planner) II. BSSP(Regression Planner
vikas dhakane
 
Gamma and Colour Space
Gamma and Colour SpaceGamma and Colour Space
Gamma and Colour Space
University of Sunderland
 
Hadoop architecture-tutorial
Hadoop  architecture-tutorialHadoop  architecture-tutorial
Hadoop architecture-tutorial
vinayiqbusiness
 
I. Mini-Max Algorithm in AI
I. Mini-Max Algorithm in AII. Mini-Max Algorithm in AI
I. Mini-Max Algorithm in AI
vikas dhakane
 
Data mining Part 1
Data mining Part 1Data mining Part 1
Data mining Part 1
Gautam Kumar
 
Python Seaborn Data Visualization
Python Seaborn Data Visualization Python Seaborn Data Visualization
Python Seaborn Data Visualization
Sourabh Sahu
 
Text similarity measures
Text similarity measuresText similarity measures
Text similarity measures
ankit_ppt
 
Unsupervised learning
Unsupervised learningUnsupervised learning
Unsupervised learning
amalalhait
 
Learning by analogy
Learning by analogyLearning by analogy
Learning by analogy
Nitesh Singh
 
Unification and Lifting
Unification and LiftingUnification and Lifting
Unification and Lifting
Megha Sharma
 
Unsupervised learning Algorithms and Assumptions
Unsupervised learning Algorithms and AssumptionsUnsupervised learning Algorithms and Assumptions
Unsupervised learning Algorithms and Assumptions
refedey275
 
Introduction to Principle Component Analysis
Introduction to Principle Component AnalysisIntroduction to Principle Component Analysis
Introduction to Principle Component Analysis
Sunjeet Jena
 
2.mathematics for machine learning
2.mathematics for machine learning2.mathematics for machine learning
2.mathematics for machine learning
KONGU ENGINEERING COLLEGE
 
partial-order.ppt
partial-order.pptpartial-order.ppt
partial-order.ppt
SadagopanS
 
3.1,2,3 pushdown automata definition, moves &amp; id
3.1,2,3 pushdown automata   definition, moves &amp; id3.1,2,3 pushdown automata   definition, moves &amp; id
3.1,2,3 pushdown automata definition, moves &amp; id
Sampath Kumar S
 
Intelligent agent
Intelligent agent Intelligent agent
Intelligent agent
Arvind sahu
 
Implement principal component analysis (PCA) in python from scratch
Implement principal component analysis (PCA) in python from scratchImplement principal component analysis (PCA) in python from scratch
Implement principal component analysis (PCA) in python from scratch
EshanAgarwal4
 
Image denoising algorithms
Image denoising algorithmsImage denoising algorithms
Image denoising algorithms
Mohammad Sunny
 
DESIGN AND ANALYSIS OF ALGORITHMS
DESIGN AND ANALYSIS OF ALGORITHMSDESIGN AND ANALYSIS OF ALGORITHMS
DESIGN AND ANALYSIS OF ALGORITHMS
Gayathri Gaayu
 
I. FSSP(Progression Planner) II. BSSP(Regression Planner
I. FSSP(Progression Planner) II. BSSP(Regression PlannerI. FSSP(Progression Planner) II. BSSP(Regression Planner
I. FSSP(Progression Planner) II. BSSP(Regression Planner
vikas dhakane
 
Hadoop architecture-tutorial
Hadoop  architecture-tutorialHadoop  architecture-tutorial
Hadoop architecture-tutorial
vinayiqbusiness
 
I. Mini-Max Algorithm in AI
I. Mini-Max Algorithm in AII. Mini-Max Algorithm in AI
I. Mini-Max Algorithm in AI
vikas dhakane
 
Data mining Part 1
Data mining Part 1Data mining Part 1
Data mining Part 1
Gautam Kumar
 
Python Seaborn Data Visualization
Python Seaborn Data Visualization Python Seaborn Data Visualization
Python Seaborn Data Visualization
Sourabh Sahu
 
Text similarity measures
Text similarity measuresText similarity measures
Text similarity measures
ankit_ppt
 
Unsupervised learning
Unsupervised learningUnsupervised learning
Unsupervised learning
amalalhait
 
Learning by analogy
Learning by analogyLearning by analogy
Learning by analogy
Nitesh Singh
 
Unification and Lifting
Unification and LiftingUnification and Lifting
Unification and Lifting
Megha Sharma
 
Unsupervised learning Algorithms and Assumptions
Unsupervised learning Algorithms and AssumptionsUnsupervised learning Algorithms and Assumptions
Unsupervised learning Algorithms and Assumptions
refedey275
 
Introduction to Principle Component Analysis
Introduction to Principle Component AnalysisIntroduction to Principle Component Analysis
Introduction to Principle Component Analysis
Sunjeet Jena
 
partial-order.ppt
partial-order.pptpartial-order.ppt
partial-order.ppt
SadagopanS
 
3.1,2,3 pushdown automata definition, moves &amp; id
3.1,2,3 pushdown automata   definition, moves &amp; id3.1,2,3 pushdown automata   definition, moves &amp; id
3.1,2,3 pushdown automata definition, moves &amp; id
Sampath Kumar S
 
Intelligent agent
Intelligent agent Intelligent agent
Intelligent agent
Arvind sahu
 
Implement principal component analysis (PCA) in python from scratch
Implement principal component analysis (PCA) in python from scratchImplement principal component analysis (PCA) in python from scratch
Implement principal component analysis (PCA) in python from scratch
EshanAgarwal4
 

Similar to Project gnuplot (20)

Gnuplot 2
Gnuplot 2Gnuplot 2
Gnuplot 2
FarkhandaAna
 
Cc code cards
Cc code cardsCc code cards
Cc code cards
ysolanki78
 
How to solve misalignment lun netapp on linux servers by Ivan
How to solve misalignment lun netapp on linux servers by IvanHow to solve misalignment lun netapp on linux servers by Ivan
How to solve misalignment lun netapp on linux servers by Ivan
Ivan Silva
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
Mohan Raj
 
Deep Learning, Scala, and Spark
Deep Learning, Scala, and SparkDeep Learning, Scala, and Spark
Deep Learning, Scala, and Spark
Oswald Campesato
 
Python Course Basic
Python Course BasicPython Course Basic
Python Course Basic
Naiyan Noor
 
Linux Shortcuts and Commands:
Linux Shortcuts and Commands:Linux Shortcuts and Commands:
Linux Shortcuts and Commands:
wensheng wei
 
Advance Computer Architecture
Advance Computer ArchitectureAdvance Computer Architecture
Advance Computer Architecture
Vrushali Lanjewar
 
MapReduce: teoria e prática
MapReduce: teoria e práticaMapReduce: teoria e prática
MapReduce: teoria e prática
PET Computação
 
Computer Graphics Project Report on Sinking Ship using OpenGL
Computer Graphics Project Report on Sinking Ship using OpenGL Computer Graphics Project Report on Sinking Ship using OpenGL
Computer Graphics Project Report on Sinking Ship using OpenGL
Sharath Raj
 
matplotlib-installatin-interactive-contour-example-guide
matplotlib-installatin-interactive-contour-example-guidematplotlib-installatin-interactive-contour-example-guide
matplotlib-installatin-interactive-contour-example-guide
Arulalan T
 
Deep learning - the conf br 2018
Deep learning - the conf br 2018Deep learning - the conf br 2018
Deep learning - the conf br 2018
Fabio Janiszevski
 
Composing an App with Free Monads (using Cats)
Composing an App with Free Monads (using Cats)Composing an App with Free Monads (using Cats)
Composing an App with Free Monads (using Cats)
Hermann Hueck
 
20 keyboard shortcuts for your linux machine
20 keyboard shortcuts for your linux machine20 keyboard shortcuts for your linux machine
20 keyboard shortcuts for your linux machine
Youssoufou YABRE
 
iPython
iPythoniPython
iPython
Aman Lalpuria
 
Linux Tracing Superpowers by Eugene Pirogov
Linux Tracing Superpowers by Eugene PirogovLinux Tracing Superpowers by Eugene Pirogov
Linux Tracing Superpowers by Eugene Pirogov
Pivorak MeetUp
 
pyton Notes1
pyton Notes1pyton Notes1
pyton Notes1
Amba Research
 
06.09.2017 Computer Science, Machine Learning & Statistiks Meetup - MULTI-GPU...
06.09.2017 Computer Science, Machine Learning & Statistiks Meetup - MULTI-GPU...06.09.2017 Computer Science, Machine Learning & Statistiks Meetup - MULTI-GPU...
06.09.2017 Computer Science, Machine Learning & Statistiks Meetup - MULTI-GPU...
Zalando adtech lab
 
Python Visualization API Primersubplots
Python Visualization  API PrimersubplotsPython Visualization  API Primersubplots
Python Visualization API Primersubplots
VidhyaB10
 
main.pdf java programming practice for programs
main.pdf java programming practice for programsmain.pdf java programming practice for programs
main.pdf java programming practice for programs
RavinderKSingla
 
How to solve misalignment lun netapp on linux servers by Ivan
How to solve misalignment lun netapp on linux servers by IvanHow to solve misalignment lun netapp on linux servers by Ivan
How to solve misalignment lun netapp on linux servers by Ivan
Ivan Silva
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
Mohan Raj
 
Deep Learning, Scala, and Spark
Deep Learning, Scala, and SparkDeep Learning, Scala, and Spark
Deep Learning, Scala, and Spark
Oswald Campesato
 
Python Course Basic
Python Course BasicPython Course Basic
Python Course Basic
Naiyan Noor
 
Linux Shortcuts and Commands:
Linux Shortcuts and Commands:Linux Shortcuts and Commands:
Linux Shortcuts and Commands:
wensheng wei
 
Advance Computer Architecture
Advance Computer ArchitectureAdvance Computer Architecture
Advance Computer Architecture
Vrushali Lanjewar
 
MapReduce: teoria e prática
MapReduce: teoria e práticaMapReduce: teoria e prática
MapReduce: teoria e prática
PET Computação
 
Computer Graphics Project Report on Sinking Ship using OpenGL
Computer Graphics Project Report on Sinking Ship using OpenGL Computer Graphics Project Report on Sinking Ship using OpenGL
Computer Graphics Project Report on Sinking Ship using OpenGL
Sharath Raj
 
matplotlib-installatin-interactive-contour-example-guide
matplotlib-installatin-interactive-contour-example-guidematplotlib-installatin-interactive-contour-example-guide
matplotlib-installatin-interactive-contour-example-guide
Arulalan T
 
Deep learning - the conf br 2018
Deep learning - the conf br 2018Deep learning - the conf br 2018
Deep learning - the conf br 2018
Fabio Janiszevski
 
Composing an App with Free Monads (using Cats)
Composing an App with Free Monads (using Cats)Composing an App with Free Monads (using Cats)
Composing an App with Free Monads (using Cats)
Hermann Hueck
 
20 keyboard shortcuts for your linux machine
20 keyboard shortcuts for your linux machine20 keyboard shortcuts for your linux machine
20 keyboard shortcuts for your linux machine
Youssoufou YABRE
 
Linux Tracing Superpowers by Eugene Pirogov
Linux Tracing Superpowers by Eugene PirogovLinux Tracing Superpowers by Eugene Pirogov
Linux Tracing Superpowers by Eugene Pirogov
Pivorak MeetUp
 
06.09.2017 Computer Science, Machine Learning & Statistiks Meetup - MULTI-GPU...
06.09.2017 Computer Science, Machine Learning & Statistiks Meetup - MULTI-GPU...06.09.2017 Computer Science, Machine Learning & Statistiks Meetup - MULTI-GPU...
06.09.2017 Computer Science, Machine Learning & Statistiks Meetup - MULTI-GPU...
Zalando adtech lab
 
Python Visualization API Primersubplots
Python Visualization  API PrimersubplotsPython Visualization  API Primersubplots
Python Visualization API Primersubplots
VidhyaB10
 
main.pdf java programming practice for programs
main.pdf java programming practice for programsmain.pdf java programming practice for programs
main.pdf java programming practice for programs
RavinderKSingla
 
Ad

Recently uploaded (20)

chapter3 Central Tendency statistics.ppt
chapter3 Central Tendency statistics.pptchapter3 Central Tendency statistics.ppt
chapter3 Central Tendency statistics.ppt
justinebandajbn
 
How iCode cybertech Helped Me Recover My Lost Funds
How iCode cybertech Helped Me Recover My Lost FundsHow iCode cybertech Helped Me Recover My Lost Funds
How iCode cybertech Helped Me Recover My Lost Funds
ireneschmid345
 
EDU533 DEMO.pptxccccvbnjjkoo jhgggggbbbb
EDU533 DEMO.pptxccccvbnjjkoo jhgggggbbbbEDU533 DEMO.pptxccccvbnjjkoo jhgggggbbbb
EDU533 DEMO.pptxccccvbnjjkoo jhgggggbbbb
JessaMaeEvangelista2
 
Secure_File_Storage_Hybrid_Cryptography.pptx..
Secure_File_Storage_Hybrid_Cryptography.pptx..Secure_File_Storage_Hybrid_Cryptography.pptx..
Secure_File_Storage_Hybrid_Cryptography.pptx..
yuvarajreddy2002
 
Ppt. Nikhil.pptxnshwuudgcudisisshvehsjks
Ppt. Nikhil.pptxnshwuudgcudisisshvehsjksPpt. Nikhil.pptxnshwuudgcudisisshvehsjks
Ppt. Nikhil.pptxnshwuudgcudisisshvehsjks
panchariyasahil
 
Cleaned_Lecture 6666666_Simulation_I.pdf
Cleaned_Lecture 6666666_Simulation_I.pdfCleaned_Lecture 6666666_Simulation_I.pdf
Cleaned_Lecture 6666666_Simulation_I.pdf
alcinialbob1234
 
Geometry maths presentation for begginers
Geometry maths presentation for begginersGeometry maths presentation for begginers
Geometry maths presentation for begginers
zrjacob283
 
VKS-Python-FIe Handling text CSV Binary.pptx
VKS-Python-FIe Handling text CSV Binary.pptxVKS-Python-FIe Handling text CSV Binary.pptx
VKS-Python-FIe Handling text CSV Binary.pptx
Vinod Srivastava
 
LLM finetuning for multiple choice google bert
LLM finetuning for multiple choice google bertLLM finetuning for multiple choice google bert
LLM finetuning for multiple choice google bert
ChadapornK
 
1. Briefing Session_SEED with Hon. Governor Assam - 27.10.pdf
1. Briefing Session_SEED with Hon. Governor Assam - 27.10.pdf1. Briefing Session_SEED with Hon. Governor Assam - 27.10.pdf
1. Briefing Session_SEED with Hon. Governor Assam - 27.10.pdf
Simran112433
 
Data Science Courses in India iim skills
Data Science Courses in India iim skillsData Science Courses in India iim skills
Data Science Courses in India iim skills
dharnathakur29
 
Principles of information security Chapter 5.ppt
Principles of information security Chapter 5.pptPrinciples of information security Chapter 5.ppt
Principles of information security Chapter 5.ppt
EstherBaguma
 
Stack_and_Queue_Presentation_Final (1).pptx
Stack_and_Queue_Presentation_Final (1).pptxStack_and_Queue_Presentation_Final (1).pptx
Stack_and_Queue_Presentation_Final (1).pptx
binduraniha86
 
C++_OOPs_DSA1_Presentation_Template.pptx
C++_OOPs_DSA1_Presentation_Template.pptxC++_OOPs_DSA1_Presentation_Template.pptx
C++_OOPs_DSA1_Presentation_Template.pptx
aquibnoor22079
 
AI Competitor Analysis: How to Monitor and Outperform Your Competitors
AI Competitor Analysis: How to Monitor and Outperform Your CompetitorsAI Competitor Analysis: How to Monitor and Outperform Your Competitors
AI Competitor Analysis: How to Monitor and Outperform Your Competitors
Contify
 
DPR_Expert_Recruitment_notice_Revised.pdf
DPR_Expert_Recruitment_notice_Revised.pdfDPR_Expert_Recruitment_notice_Revised.pdf
DPR_Expert_Recruitment_notice_Revised.pdf
inmishra17121973
 
Flip flop presenation-Presented By Mubahir khan.pptx
Flip flop presenation-Presented By Mubahir khan.pptxFlip flop presenation-Presented By Mubahir khan.pptx
Flip flop presenation-Presented By Mubahir khan.pptx
mubashirkhan45461
 
Safety Innovation in Mt. Vernon A Westchester County Model for New Rochelle a...
Safety Innovation in Mt. Vernon A Westchester County Model for New Rochelle a...Safety Innovation in Mt. Vernon A Westchester County Model for New Rochelle a...
Safety Innovation in Mt. Vernon A Westchester County Model for New Rochelle a...
James Francis Paradigm Asset Management
 
Digilocker under workingProcess Flow.pptx
Digilocker  under workingProcess Flow.pptxDigilocker  under workingProcess Flow.pptx
Digilocker under workingProcess Flow.pptx
satnamsadguru491
 
FPET_Implementation_2_MA to 360 Engage Direct.pptx
FPET_Implementation_2_MA to 360 Engage Direct.pptxFPET_Implementation_2_MA to 360 Engage Direct.pptx
FPET_Implementation_2_MA to 360 Engage Direct.pptx
ssuser4ef83d
 
chapter3 Central Tendency statistics.ppt
chapter3 Central Tendency statistics.pptchapter3 Central Tendency statistics.ppt
chapter3 Central Tendency statistics.ppt
justinebandajbn
 
How iCode cybertech Helped Me Recover My Lost Funds
How iCode cybertech Helped Me Recover My Lost FundsHow iCode cybertech Helped Me Recover My Lost Funds
How iCode cybertech Helped Me Recover My Lost Funds
ireneschmid345
 
EDU533 DEMO.pptxccccvbnjjkoo jhgggggbbbb
EDU533 DEMO.pptxccccvbnjjkoo jhgggggbbbbEDU533 DEMO.pptxccccvbnjjkoo jhgggggbbbb
EDU533 DEMO.pptxccccvbnjjkoo jhgggggbbbb
JessaMaeEvangelista2
 
Secure_File_Storage_Hybrid_Cryptography.pptx..
Secure_File_Storage_Hybrid_Cryptography.pptx..Secure_File_Storage_Hybrid_Cryptography.pptx..
Secure_File_Storage_Hybrid_Cryptography.pptx..
yuvarajreddy2002
 
Ppt. Nikhil.pptxnshwuudgcudisisshvehsjks
Ppt. Nikhil.pptxnshwuudgcudisisshvehsjksPpt. Nikhil.pptxnshwuudgcudisisshvehsjks
Ppt. Nikhil.pptxnshwuudgcudisisshvehsjks
panchariyasahil
 
Cleaned_Lecture 6666666_Simulation_I.pdf
Cleaned_Lecture 6666666_Simulation_I.pdfCleaned_Lecture 6666666_Simulation_I.pdf
Cleaned_Lecture 6666666_Simulation_I.pdf
alcinialbob1234
 
Geometry maths presentation for begginers
Geometry maths presentation for begginersGeometry maths presentation for begginers
Geometry maths presentation for begginers
zrjacob283
 
VKS-Python-FIe Handling text CSV Binary.pptx
VKS-Python-FIe Handling text CSV Binary.pptxVKS-Python-FIe Handling text CSV Binary.pptx
VKS-Python-FIe Handling text CSV Binary.pptx
Vinod Srivastava
 
LLM finetuning for multiple choice google bert
LLM finetuning for multiple choice google bertLLM finetuning for multiple choice google bert
LLM finetuning for multiple choice google bert
ChadapornK
 
1. Briefing Session_SEED with Hon. Governor Assam - 27.10.pdf
1. Briefing Session_SEED with Hon. Governor Assam - 27.10.pdf1. Briefing Session_SEED with Hon. Governor Assam - 27.10.pdf
1. Briefing Session_SEED with Hon. Governor Assam - 27.10.pdf
Simran112433
 
Data Science Courses in India iim skills
Data Science Courses in India iim skillsData Science Courses in India iim skills
Data Science Courses in India iim skills
dharnathakur29
 
Principles of information security Chapter 5.ppt
Principles of information security Chapter 5.pptPrinciples of information security Chapter 5.ppt
Principles of information security Chapter 5.ppt
EstherBaguma
 
Stack_and_Queue_Presentation_Final (1).pptx
Stack_and_Queue_Presentation_Final (1).pptxStack_and_Queue_Presentation_Final (1).pptx
Stack_and_Queue_Presentation_Final (1).pptx
binduraniha86
 
C++_OOPs_DSA1_Presentation_Template.pptx
C++_OOPs_DSA1_Presentation_Template.pptxC++_OOPs_DSA1_Presentation_Template.pptx
C++_OOPs_DSA1_Presentation_Template.pptx
aquibnoor22079
 
AI Competitor Analysis: How to Monitor and Outperform Your Competitors
AI Competitor Analysis: How to Monitor and Outperform Your CompetitorsAI Competitor Analysis: How to Monitor and Outperform Your Competitors
AI Competitor Analysis: How to Monitor and Outperform Your Competitors
Contify
 
DPR_Expert_Recruitment_notice_Revised.pdf
DPR_Expert_Recruitment_notice_Revised.pdfDPR_Expert_Recruitment_notice_Revised.pdf
DPR_Expert_Recruitment_notice_Revised.pdf
inmishra17121973
 
Flip flop presenation-Presented By Mubahir khan.pptx
Flip flop presenation-Presented By Mubahir khan.pptxFlip flop presenation-Presented By Mubahir khan.pptx
Flip flop presenation-Presented By Mubahir khan.pptx
mubashirkhan45461
 
Safety Innovation in Mt. Vernon A Westchester County Model for New Rochelle a...
Safety Innovation in Mt. Vernon A Westchester County Model for New Rochelle a...Safety Innovation in Mt. Vernon A Westchester County Model for New Rochelle a...
Safety Innovation in Mt. Vernon A Westchester County Model for New Rochelle a...
James Francis Paradigm Asset Management
 
Digilocker under workingProcess Flow.pptx
Digilocker  under workingProcess Flow.pptxDigilocker  under workingProcess Flow.pptx
Digilocker under workingProcess Flow.pptx
satnamsadguru491
 
FPET_Implementation_2_MA to 360 Engage Direct.pptx
FPET_Implementation_2_MA to 360 Engage Direct.pptxFPET_Implementation_2_MA to 360 Engage Direct.pptx
FPET_Implementation_2_MA to 360 Engage Direct.pptx
ssuser4ef83d
 
Ad

Project gnuplot

  • 1. ‘ GNUPLOT & ITS APPLICATIONS’ Sabyasachi Ray Roll no.03 , Part 2 Department of physics University of North Bengal
  • 2.  Scientists runs simulations or take measurements. These data need to be presented in an appealing and professional manner.  Sometimes there are a lot of data. Sometimes it is difficult to make the interesting features come out right. Sometimes many plots must be produced.  Manually doing plot with indefinitely large no. of data are very difficult job. These different necessity of plotting insists people to develop some way to save time as well as hard working.
  • 3. GNUPLOT: a SOLUTION  There are lots of other plotting tools available for creating 1D or 2D plots from numerical data in different operating systems  Though many plotting tools are available now- a-days , one of the best advantages of ‘gnuplot’ over (say) MATHEMATICA or MAPLE GRAPHS is that it is incredibly easy to write scripts to automatically create graphs for people from raw data.
  • 4. What is gnuplot?  gnuplot is a command-driven interactive function and data plotting program. It can be used to plot functions and data points in both two and three dimensional plots in many different formats.
  • 5. GNUPLOT : HISTORY  Software developer: Original software: THOMAS WILLIAMS,COLIN KELLEY gnuplot 2.0 additions: RUSSELL LANG, DAVID KOTZ, JOHN CAMPBELL gnuplot 3.0 additions: GERSHON ELBER,ALEXANDER WOO & MANY OTHERS gnuplot 4.0 additions: HANS-BERNHARD BRӦKER, ETHANA-MERIT AND OTHERS
  • 6. GNUPLOT: supporting operating system  precompiled executables and source code for gnuplot is downloadable for 1) windows , 2) DOS, 3) Unix, 4) Linux. Gnuplot is preinstalled in most of the LINUX system
  • 7. LINUX  ‘gnuplot’ is a software works in almost every platform. I do my PROJECT WORK in FEDORACORE 3 (LINUX) platform. As scientific world mostly uses the LINUX platform.
  • 8. WORLD-WIDE LINUX  The governments of many third world nations like BRAZIL, SPAIN,CHINA,PERU,PAKISTAN and INDIA are actively involved in promoting LINUX and associate open source softwares.  LINUX has found its way to Cell-Phones, desktops and office computers.  the LHC itself is controlled by LINUX
  • 9. Installing Fedora:requirement  A pentium-class PC (at least 200 MHz for text mode; 400 MHz Pentium II for GUI)  64 Mb RAM (for text mode)  192 Mb RAM (for GUI mode)
  • 10. Minimum hard-disk space 620Mb for minimum custom install 2.3 Gb for personal desktop 3.0 Gb for workstation 1.1 Gb for server install A everything install requires at least 6.9Gb
  • 11. Linux: installation  I installed fedora core 3 in a desktop.  There are different steps one should follow while installing.  The important thing is the PARTITION of hard drive.
  • 12. Linux: installation  I choose …  DISK PARTITION  MANUALLY⤶  /boot=100 Mb  /swap=996 Mb  /home=10001 Mb  / =10001 Mb  free==1961 Kb
  • 13. Plotting:What does gnuplot offer?  Plotting two-dimensional functions and data points in many different styles (points, lines, error bars)  Plotting three-dimensional data points and surfaces in many different styles (contour plot)  Algebraic computation in integer, float and complex arithmetic  User-defined functions  Support for a large number of operating systems, graphics file formats and output devices  Extensive on-line help  TEX-like text formatting for labels, titles, axes, data points  Interactive command line editing and history .
  • 14. Starting : GNUPLOT  To start gnuplot in LINUX we have to simply type gnuplot in the command line of the linux terminal as follows:  gnuplot  This command gives:
  • 15. Starting : GNUPLOT G N U P L O T Version 4.0 patchlevel 0 last modified Thu Apr 15 14:44:22 CEST 2004 System: Linux 2.4.23 Copyright (C) 1986 - 1993, 1998, 2004 Thomas Williams, Colin Kelley and many others This is gnuplot version 4.0. Please refer to the documentation for command syntax changes. The old syntax will be accepted throughout the 4.0 series, but all save files use the new syntax. Type `help` to access the on-line reference manual. The gnuplot FAQ is available from http://www.gnuplot.info/faq/ Send comments and requests for help to <[email protected]> Send bugs, suggestions and mods to <[email protected]> Terminal type set to 'x11' gnuplot>
  • 16. Starting : GNUPLOT Now gnuplot is ready to perform different commands that it supports
  • 17. Gnuplot: functions  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
  • 18. Gnuplot: functions  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  E.T.C.
  • 19. Gnuplot: as calculator  gnuplot> print abs({3,4})  5.0  gnuplot> print log(100)  4.60517  gnuplot> print log10(100)  2.0  gnuplot> print rand(100)  0.13348
  • 20. Gnuplot: as calculator  gnuplot> print sqrt(100)  10.0  gnuplot> print gamma(4)  6.0  gnuplot> print 3!  6.0  Like that
  • 21. Gnuplot: as calculator gnuplot> print 1/3 0  How strange!!!
  • 22. Gnuplot: as calculator Gnuplot does integer, and not floating point, arithmetic on integer expressions gnuplot> print 1./3. 0.333333
  • 23. gnuplot: plotting applications  the primary commands in Gnuplot:-  plot -2D  splot -3D  replot.
  • 24. Gnuplot: plotting functions  To plot functions simply one have to type: plot [function] at the gnuplot> prompt.  say plot sin(x) to draw a first figure.  Say replot sin(x)**2 to add a second plot  Say plot sin(x),-sin(x) to plot two graphs at once.  Also one can define external function as gnuplot> f(x)=3*x**4 gnuplot> plot f(x)
  • 25. Gnuplot: plotting functions  gnuplot> plot sin(x)
  • 27. Gnuplot: plotting functions gnuplot> f(x)=3*x**4 gnuplot> plot f(x)
  • 28. Gnuplot: plotting functions  gnuplot> splot sin(x*y/20)
  • 29. gnuplot: Plotting data  For example my data file, force.dat , might look like:  0.000 0 0  0.001 104 51  0.002 202 101  0.003 298 148  0.0031 290 149  0.004 289 201  0.0041 291 209  0.005 310 250  0.010 311 260  0.020 280 240
  • 30. gnuplot: Plotting data  One can display plot data by typing:  gnuplot> plot "force.dat" using 1:2 title 'Column', "force.dat" using 1:3 title 'Beam’  If the data are in multiple data files. In this case one should plot by using a command like:  gnuplot> plot "fileA.dat" using 1:2 title 'data A', "fileB.dat" using 1:3 title 'data B'
  • 31. gnuplot: plot command customization  Plots may be displayed in one of the styles: lines, points, linespoints, impulses, dots, steps, fsteps, histeps, errorbars, xerrorbars, yerrorbars, xyerrorbars, boxes, boxerrorbars, boxxyerrorbars, financebars, candlesticks or vector To specify the line/point style use the plot command as follows:   gnuplot> plot "force.dat" using 1:2 title 'Column' with lines, "force.dat" u 1:3 t 'Beam' w linespoints
  • 32. gnuplot: PRINTING  One can create a PostScript file of plot by using the following :  gnuplot> set terminal postscript  gnuplot> set output "my-plot.ps"  gnuplot> plot sin(x)
  • 33. gnuplot: Commands to Quit  exit or quit command terminates gnuplot.  Once one quit gnuplot, all of setting one made will be lost.  To save the current setting, use save command followed by a file name in which parameters and functions one defined are stored.  gnuplot overwrites internal parameters in that file without any warnings.
  • 34. gnuplot: Commands to Save Parameters  gnuplot> save "savefile.plt"  the saved file is a usual text file.  one can edit the contents with a text editor.  To draw a graph again with this file, we use the load "savefile.plt" command at the gnuplot command-line-  gnuplot> load "savefile.plt"
  • 35. application: gnuplot  Now different kind of plotting and fitting that I made are shown and explained in the next coming slides.
  • 36. simple ploting using sin(x)  gnuplot> set terminal postscript  gnuplot> set output 'sin.pdf'  gnuplot> plot sin(x)
  • 37. simple ploting using sin(x)  To set the X range 0 to 5, [0:5]  gnuplot> plot [0:5] sin(x)
  • 38. simple ploting using sin(x)  gnuplot> set angle degree  gnuplot> set xrange[-270:270]  gnuplot> plot sin(x)
  • 39.  gnuplot> set xrange [-2*pi:2*pi]  gnuplot> a=0.5  gnuplot> plot a*sin(x)
  • 40. gnuplot: different styles available  Now say some data file named "output.dat" contains some nature as shown below.  gnuplot> plot "output.dat" title ‘style1’ with lines.
  • 41. gnuplot: different styles available  gnuplot> plot "output.dat" title ‘style2’ with points
  • 42. gnuplot: customizing styles  gnuplot> plot "output.dat" title ‘style3’ with steps.
  • 43. gnuplot: customizing styles  gnuplot> plot "output.dat" title ‘style4’ with impulses
  • 44. gnuplot: plotting of two sets of data from a single data file  The taken data file was named ‘ lateral density.txt’  #lateral density.txt  gnuplot> set terminal postscript  gnuplot> set output 'lateral density.pdf'  gnuplot> set logscale
  • 45. gnuplot: plotting of two sets of data from a single data file  gnuplot> set title 'PLOTTING OF TWO SETS OF DATA FROM A DATA FILE‘  gnuplot> set xrange [8:75]  gnuplot> set yrange [0.1:3.0]  gnuplot> set xlabel 'CORE DISTANCE(meter)'  gnuplot> set ylabel 'DENSITY (particle/square meter)'  gnuplot> plot 'lateral density.txt' u 1:3 title 'experimental density' w p 3,  > 'lateral density.txt' u 1:2 title 'theoretical density' w p 4
  • 46. gnuplot: plotting of two sets of data from a single data file
  • 47. gnuplot: plotting of two sets of data from a single data file  gnuplot> replot 'lateral density.txt' u 1:2 w l title 'theoretical graph‘
  • 48. gnuplot: plotting of two sets of data from two different data files and comparing them  two data file are ‘absorptionrade’ & ‘absorptionsr’  gnuplot> set terminal postscript Terminal type set to 'postscript' Options are 'landscape noenhanced monochrome blacktext dashed dashlength 1.0 linewidth 1.0 defaultplex palfuncparam 2000,0.003 butt "Helvetica" 14'  gnuplot> unset logscale  gnuplot> set output 'absorption plot.ps'  gnuplot> set xlabel 'Corrected thickness (mg/cm^2)'  gnuplot> set ylabel 'counts/minute'  gnuplot> set title'BETA ABSORPTION CURVE'
  • 49. gnuplot: plotting of two sets of data from two different data files and comparing them  gnuplot> plot 'absorptionrade' w p 3,'absorptionsr' title'comparing two sources'
  • 50. gnuplot: linear curve fitting  The data file that I choose for this case is:  Age.txt  gnuplot> set output 'age.ps'  gnuplot> set title 'LINEAR CURVE FITTING FOR DATA FILE USING GNUPLOT'  gnuplot> set label 'z=zenith angle' at 1.1 ,1.6
  • 51. gnuplot: linear curve fitting  gnuplot> set xrange[1:1.5]  gnuplot> set yrange[1.25:1.65]  gnuplot> set xlabel 'sec(z)'  gnuplot> set ylabel 'SHOWER AGE'  gnuplot> f(x)=(m*x)+c  gnuplot> m=1.4;c=-0.13  gnuplot> fit f(x) 'age.txt' u 1:2 via m,c  After 4 iterations the fit converged.and it is shown on the screen
  • 52. gnuplot: linear curve fitting  gnuplot> set label 'f(x)=m*x+c,m=0.98,c=o.30' at 1.3,1.5  gnuplot> plot 'age.txt' u 1:2:3 w yerrorbars title 'f(x)=m*x+c',  > f(x) title 'fitted curve‘ these commands will produce :
  • 54. linear curve fitting of more than one plot in a single graph:  My data file is ‘test.txt’ that I used in my this particular plotting:  gnuplot> set terminal postscript  gnuplot> set output 'manyplot.ps'  gnuplot> set title ' PLOTING & LINEAR FITTING OF MORE THAN ONE DATA SETS AT A TIME'  gnuplot> set xlabel 'sec(z)'  gnuplot> set ylabel 'shower age'  gnuplot> set label 'z is the zenith angle' at 1.1,1.5  gnuplot> set xrange[1:1.4]  gnuplot> set yrange [1:1.55]
  • 55.  gnuplot> f1(x)=a1*x+b1  gnuplot> a1=-2;b1=3.28  gnuplot> fit f1(x) 'test.txt' u 1:2 via a1,b1  the fitting command for 2nd set of data points are:  gnuplot> f2(x)=a2*x+b2  gnuplot> a2=0.067;b2=1.173  gnuplot> fit f2(x) 'test.txt' u 1:4 via a2,b2  the fitting command for 3rd set of data points are:  gnuplot> f3(x)=a3*x+b3  gnuplot> a3=2;b3=-1.17  gnuplot> fit f3(x) 'test.txt' u 1:6 via a3,b3
  • 56. linear curve fitting of more than one plot in a single graph:  gnuplot> plot 'test.txt' u 1:2:3 w yerrorbars title' Fe',  > f1(x) title 'y=0.31*x+0.95',  > 'test.txt' u 1:4:5 w yerrorbars title ' Mixed',  > f2(x) title 'y=0.17*x+1.07',  > 'test.txt' u 1:6:7 w yerrorbars title ' proton',  > f3(x) title 'y=.26*x+.83'  These produce:
  • 58. non-linear curve fitting  For non-linear curve fitting I take the data file 'lateral density.txt'  gnuplot> set output 'nonlinear.ps'  gnuplot> set logscale  gnuplot> set xrange [8:75]  gnuplot> set yrange [0.1:3.0]  gnuplot> set xlabel 'CORE DISTANCE(meter)'  gnuplot> set ylabel 'DENSITY (particle/square meter)'  gnuplot> set title 'NON-LINEAR FITTING (more than one line)'  gnuplot> set label 'y=(a+b*x+c*x**2+d*x**3)**3' at 30,1
  • 59. non-linear curve fitting  gnuplot> f1(x)=(a1+b1*x+c1*x**2+d1*x**3)**3  gnuplot> a1=10;b1=20;c1=-4;d1=6;  gnuplot> fit f1(x) 'lateral density.txt' u 1:2 via a1,b1,c1,d1  gnuplot> f2(x)=(a2+b2*x+c2*x**2+d2*x**3)**3  gnuplot> a2=1;b2=20;c2=-4;d2=6  gnuplot> fit f2(x) 'lateral density.txt' u 1:3 via a2,b2,c2,d2
  • 60. non-linear curve fitting  gnuplot> plot 'lateral density.txt' u 1:2 title 'theoretical' ,  > f1(x) title 'a=1.77,b=-0.05,c=0.0011,d=-8.39e-6' ,  > 'lateral density.txt' u 1:3 title 'experimental' ,  > f2(x) title 'a=1.81,b=-0.06,c=0.001,d=-6.37e-6'
  • 61. 3-DIMENSIONAL PLOT USING GNUPLOT:  gnuplot> set output '3d.ps'  gnuplot> set title 'the function choosen is sin(x*y/20)'  gnuplot> set xr [-10:10]  gnuplot> set yr [-10:10]  gnuplot> set zr [-1:1]  gnuplot> set xlabel 'x-axis'  gnuplot> set ylabel 'y-axis'  gnuplot> set zlabel 'z-axis'  gnuplot> splot sin(x*y/20)
  • 63. The advantages  The results are repeatable. This is very useful if one needs many similar graphs, or if one potentially needs to redo graphs with updated data.  Plots can be produced automatically. Sometimes plots take a long time, especially if there are much data to be processed.  Plots can be produced on a remote supercomputer, written into a file, and then displayed locally. The data do not need to be transferred.  For a quick look at small datasets there are many tools.  For serious work gnuplot is one of the best.
  • 64. Disadvantages  Gnuplot has a limited set of line and point styles.  Gnuplot cannot output symbolic equations or formula and labels in most output formats.  Gnuplot does a poor job of making contour plots.  This is very hardworking job to remember all the commands all time.
  • 65. CONCLUSSION:  In gnuplot there are many other integrated facilities like animation. But due to shortage of time I can not learn them.  If I get an opportunity to use gnuplot in future, this project will surely help me lot.  More over I used this opportunity to learn little bit about LINUX that would also help in advanced studies.
  • 66. Bibliography  1> GNUPLOT 4.2 - A Brief Manual and Tutorial Department of Civil and Environmental Engineering Edmund T. Pratt School of Engineering Duke University - Box 90287, Durham, NC 27708-0287  2> www.gnuplot.info.  3> G N U P L O T  Version 4.0  4> ‘fast track to LINUX, a beginners guide’ –digit February 2009.  5> perfect Set up- Fedora Core 3 |HowtoForge-Linux Howtos and Tutorials  www.howtoforge.com/perfect_setup_fedora_core_3  6> book: BIBLE OF LINUX  7> http://www.duke.edu/~hpgavin/gnuplot.html.  8> http://www.cs.uni.edu/Help/gnuplot/  9> Gnuplot Short Course- Tim Langlais   10> http://t16web.lanl.gov/Kawano/gnuplot/index-e.html