# use this to histogram a column - especially distribution of scattering angles #max=0.01 #max value #min=-0.01 #min value set term pdf fontscale 0.75 size 4in,4in set output 'fiberScatter.pdf' set timestamp offset graph 1.05,0.6 rotate font 'Verdana,6' set label 'plotting_scripts/hist_fiber_scatter.gnu' at graph 1.02,0.02 rotate left font 'Verdana,6' noenhance filename = 'fort.111' max=0.5 min=0 width=(max-min)/n #interval width #function used to map a value to the intervals hist(x,width)=width*floor(x/width)+width/2.0 set xrange [min:max] #set yrange [0:] #set noytics #to put an empty boundary around the #data inside an autoscaled graph. #set offset graph 0.05,0.05,0.05,0.0 set xtics 0,0.1 set boxwidth width*0.9 set style fill solid 0.5 #fillstyle set tics out nomirror set xlabel "Energy Loss [MeV]" set ylabel "Frequency" #set ytics 50 #count and plot set title 'Fiber Energy loss '.filename plot filename u (hist(($7*3.1*1000),width)):(1.0) smooth freq w boxes lc rgb"green" not set xlabel 'Scatter [mrad]' set title 'Fiber Scattering Angle '.filename min1=0 max1=0.5 width=(max1-min1)/n1 #interval width set boxwidth width*0.9 set xrange [min1:max1] #set xtics min1,(max1-min1)/10,max1 plot filename u (hist( (($3)**2+($5)**2)**.5*1000,width)):(1.0) smooth freq w boxes lc rgb"green" not print 'fiberScatter.pdf'