set terminal pdf enhanced fontscale 0.75 size 6.0in, 6.0in #histogram distribution and overlay kicker pulse from fort.344 reset set timestamp offset graph 0.89,0.7 rotate font 'Verdana,6' set label 'plotting scripts/pulse_kicker.gnu' at graph 1.01,0.02 rotate left font ',6' noenhance #the following 1-create a file named directory. 2-modify the file adding name=" at the beginning and " at the end. Then loading. Now the character string is the path !pwd > directory !sed -n -e 's/^/name="/' -e 's/$/"/p' directory > name load 'name' print 'directory='.name set label at graph 0.,1.02 name font 'Verdana,6' noenhance outfile = 'pulse_kicker.pdf' set output outfile max=300. #max value min=0. #min value n=100 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 xtics min,(max-min)/10,max set boxwidth width*0.9 set style fill solid 0.5 #fillstyle set xtics out set ytics out nomirror set ylabel 'counts' set y2tics 0, 50 set y2label 'kicker field [G]' set xlabel "time [ns]" set xrange [-200:800] f=1.e6 plot 'fort.344' u (hist(($5*1.e9),width)):(1.0) every 10 smooth freq w boxes lc rgb"green" not,'' u ($5*1.e9):(-$10*10000) every 100 axis x1y2 w p ps .2 pt 6 not print outfile