set pdf plot"data-simple"1:2lines,\ "data-simple"1:3linespoints # simple plotting plot'2col.dat'# assumes col1=x, col2=y; shows '+' at data points plot'2col.dat'lines# connect points with a line # plot a subset of the data plot[1:5]'2col.dat'linespoints# plot the first 5 elements # add a title to your line plot'2col.dat'lines'my curve'# this is really the line-title in the legend # map the columns to the x- and y-axes plot'2col.dat'1:2# 1=x, 2=y (this is the default) plot'2col.dat'2:1# 2=x, 1=y (reverse the graph) # abbreviations plot'2col.csv'1:2l'Squared'# 'u' - using, 'w l' - with lines set'Hello, world'# plot title set'Time'# x-axis label set'Distance'# y-axis label # labels set"boiling point"10,212 # key/legend settopright setbox setleftbottom setbmargin set0.01,100 set# no key # arrow set1,15,10 set# multiplot mode (prompt changes to 'multiplot') set1,0.5 set0.0,0.5 plotsin(x),log(x) set0.0,0.0 plotsin(x),log(x),cos(x) unset# exit multiplot mode (prompt changes back to 'gnuplot') plotsin(x)'Sine Function',tan(x)'Tangent' plotsin(x) plotsin(x)/x plot'bp-hr.dat'1:2lp'systolic','bp-hr.dat'1:3lp'diastolic','bp-hr.dat'1:4lp'heartrate' setpostscript color ##setting the term set"multiple_files.ps" set center ##legend placement plot[1:5][1:120]\ for[i=1:3]"file_".i.".dat"\ 1.3 i+4\ "file\_".i.".dat"\ linespoints file_name(n)=sprintf("file_%d.dat",n) plotfor[i=1:N]file_name(i)file_name(i) # data blocks $Mydata<<EOD 112233 first line of data 445566 second line of data # comments work just as in a data file 778899 EOD stats$Mydata1:3 plot$Mydata1:3points,$Mydata1:2impulses print'`hostname -s`: '."`hostname`" style1="lines lt 4 lw 2" style2="points lt 3 pt 5 ps 2" range1="using 1:3" range2="using 1:5" plot"foo"@range1@style1,"bar"@range2@style2 v=0 if(v%2){ print"2" }elseif(v%3){ print"3" }else{ print"fred" } v=v+1;if(v%2)print"2";elseif(v%3)print"3";elseprint"fred" dofor[N=1:5]{ plotfunc(N, x) pause-1 }