This is an old revision of the document!


03. [10p] Gnuplot Scripts

The benefit of using a script is that you do not have to retype everything every time you want to make a change or want to reproduce your plot. The following is an example of a Gnuplot script that plots two graphs on a single plot.

reset # flush all the variables

set size 1,1 # use default pallet size (100% of width and height)
set multiplot  

#Graph 1
set size 0.5,1 #half the width and full height 
set origin 0,0 #x,y 
plot 'data2.txt' w l lw 0.5

#Graph 2
set size 0.5,1 
set origin 0.5,0
plot 'data3.txt' w l lw 0.5

unset multiplot

Run the script:

$ gnuplot 
gnuplot> load 'script_name'
ep/labs/05/contents/tutorial/ex3.1572188773.txt.gz ยท Last modified: 2019/10/27 17:06 by emilian.radoi
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0