unset multiplot #set term postscript enhanced color 'Times-Roman' 14 #set output "hist_out.ps" #set term png #set out filename.'_hist.ps' #set term aqua size 400, 600 #set term x11 size 400, 600 # inputs required: filename = (phase space file), events = 'number of events in histogram' reset set key right inside samplen 1 stats filename u 10 Y_MIN=0 nturns = 100 set multiplot set size 0.4,0.23 set origin 0.,0. n=100 #number of intervals scale=events/n max=100. #max value min=-100. #min value 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:] #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 min,(max-min)/5,max set boxwidth width*0.9 set style fill solid 0.5 #fillstyle set tics out nomirror #set xlabel "x[mm]" #set ylabel "Events" #count and plot unset label 1 set label 1 "x[mm]" at graph 0.05,0.8 plot filename u (hist(($4)*1.e3,width)):(1.0) smooth freq w boxes lc rgb"green" not clear Y_MAX = (1+floor(GPVAL_Y_MAX/scale)) * scale set ytics 0,(Y_MAX-Y_MIN)/4.,GPVAL_Y_MAX replot set origin 0.,0.23 max=100. #max value min=-100. #min value width=(max-min)/n #interval width set xrange [min:max] #set yrange [0:] #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 min,(max-min)/5,max set boxwidth width*0.9 set style fill solid 0.5 #fillstyle set tics out nomirror #set xlabel "y[mm]" #set ylabel "Scale" #count and plot unset label 1 set label 1 "y[mm]" at graph 0.05,0.8 plot filename u (hist(($6)*1.e3,width)):(1.0) smooth freq w boxes lc rgb"green" not "y[mm]" clear Y_MAX = (1+floor(GPVAL_Y_MAX/scale)) * scale set ytics 0,(Y_MAX-Y_MIN)/4. replot set origin 0.,0.46 max=3. #max value min=-3. #min value width=(max-min)/n #interval width set xrange [min:max] #set yrange [0:] #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 min,(max-min)/6,max set boxwidth width*0.9 set style fill solid 0.5 #fillstyle set tics out nomirror #set xlabel "dp/p[%]" #set ylabel "Events" #count and plot unset label 1 set label 1 "dp/p[%]" at graph 0.05,0.8 plot filename u (hist(($9)*1.e2,width)):(1.0) smooth freq w boxes lc rgb"green" not "dp/p[%]" clear Y_MAX = (0+floor(GPVAL_Y_MAX/scale)) * scale set ytics Y_MIN,(Y_MAX-Y_MIN)/4.,GPVAL_Y_MAX replot set origin 0.,0.69 set size 0.4,0.3 max=100. #max value min=-100. #min value width=(max-min)/n #interval width set xrange [min:max] #set autoscale #set yrange [0:] #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 min,(max-min)/10,max set xtics min,40 set boxwidth width*0.9 set style fill solid 0.5 #fillstyle set tics out nomirror #set xlabel "t[ns]" #set ylabel "Events" #count and plot set title filename unset label 1 set label 1 "t[ns]" at graph 0.05,0.8 plot filename u (hist(($10-STATS_mean)*1.e9,width)):(1.0) smooth freq w boxes lc rgb "green" not "t[ns]" clear xdif = (GPVAL_DATA_X_MAX-GPVAL_DATA_X_MIN)/5 #set xtics int(GPVAL_DATA_X_MIN/10)*10, int(xdif/10)*10, int(GPVAL_DATA_X_MAX/10)*10 nomirror Y_MAX = (0+floor(GPVAL_Y_MAX/10)) * 10 #set ytics Y_MIN,(Y_MAX-Y_MIN)/2.,GPVAL_Y_MAX #incr = (GPVAL_Y_MAX-GPVAL_Y_MIN)/4. #set ytics autofreq incr = Y_MAX/4 set ytics 0,incr replot #