term2.gp (656B)
1 reset 2 set terminal dumb size 80, 25 3 n=100 #number of intervals 4 max=5. #max value 5 min=-5. #min value 6 width=(max-min)/n #interval width 7 #function used to map a value to the intervals 8 hist(x,width)=width*floor(x/width)+width/2.0 9 set xrange [min:max] 10 set yrange [0:] 11 #to put an empty boundary around the 12 #data inside an autoscaled graph. 13 set offset graph 0.05,0.05,0.05,0.0 14 set xtics min,(max-min)/5,max 15 set boxwidth width*0.9 16 set style fill solid 0.5 #fillstyle 17 set tics out nomirror 18 set xlabel "x" 19 set ylabel "Frequency" 20 #count and plot 21 plot "data.dat" u (hist($1,width)):(1.0) smooth freq w boxes lc rgb"green" notitle 22 23 stats 'data.dat' 24 show variables all 25