This is an inofficial gnuplot FAQ (yes, its my personal one).
Look here. – Note that there are also some not so Frequently Asked Questions.
Add the shebang to the first line of your script 1)
#!/usr/bin/env gnuplot plot sin(x) with lines
E.g. to read in csv (comma-separated value) files written by spreadsheet programs.
set datafile separator ","
set decimalsign ',' # set separator to ',' #set decimalsign locale # get separator from system locale settings #set decimalsign locale "en_GB.utf8" # set separator to '.' by overriding system locale #set decimalsign locale "de_DE.utf8" # set separator to ',' by overriding system locale
set table #set terminal table # some releases of gnuplot need the keyword 'terminal' set output "temp(u).dat" set samples 1024 plot [0:1023] f(x*4.8/1024)
set terminal emf # Windows Enhanced Meta File set output "filename.emf" replot # plot again but utilize the new terminal set term pop # return to primary terminal
set format "%.1f" # output float numbers with one digit after decimal separator
Note that format can be limited to axes, e.g.
set format y "%.1f"
# define screen background color set object rectangle from screen 0,0 to screen 1,1 fillstyle border fillcolor '#deebf7' behind # define graph background color set object rectangle from graph 0,0 to graph 1,1 fillstyle border fillcolor 'white' behind
set for [i=1:8] style line i linewidth 3
# New default Matlab line colors, introduced together with parula (2014b) set style line 1 lc rgb '#0072bd' # blue set style line 2 lc rgb '#d95319' # orange set style line 3 lc rgb '#edb120' # yellow set style line 4 lc rgb '#7e2f8e' # purple set style line 5 lc rgb '#77ac30' # green set style line 6 lc rgb '#4dbeee' # light-blue set style line 7 lc rgb '#a2142f' # red
# Urheberkennzeichnung watermark = "`whoami`".'\@'."`hostname`, `date`" set label watermark at screen 0.01,0.02 font ',6' tc rgb 'gray' #set bmargin 3.75