unset multiplot #set term postscript color 'Times-Roman' 14 set terminal pdf enhanced fontscale 0.75 size 6.0in, 6.0in #!rm BACKLEG_START_phase_space.dat_hist.ps outputfile = filename.'_xy_hist.pdf' print outputfile set output outputfile #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 1.,0.5 set origin 0.,0. n=100 #number of intervals scale=events/n max=50. #max value min=-50. #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:10] #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 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 3 at graph 0.1,1.02 filename noenhance font 'Verdana 6' set label 1 "x[mm]" at graph 0.05,0.8 set label 2 'plotting scripts/hist\_xy\_phase\_space.gnu' at graph 1.02,0.02 rotate left font 'Verdana,8' plot filename u (hist(($4)*1.e3,width)):(1.0) smooth freq w boxes lc rgb"green" not clear print GPVAL_Y_MAX, scale Y_MAX = (0+floor(GPVAL_Y_MAX/scale)) * scale set ytics 0,(Y_MAX-Y_MIN)/5.,GPVAL_Y_MAX replot set origin 0.,0.5 max=50. #max value min=-50. #min value width=(max-min)/n #interval width set xrange [min:max] #set yrange [0:10] #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 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 3 unset label 2 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 scale=5 print GPVAL_Y_MAX, scale Y_MAX = (0+floor(GPVAL_Y_MAX/scale)) * scale Y_MAX = int(GPVAL_Y_MAX/scale)*scale + scale print Y_MAX, GPVAL_Y_MAX, scale set ytics 0,(Y_MAX-Y_MIN)/scale replot #