#gnuplot -e 'files = "subdir_list.dat"; filename = "scraping" ' #'filenames = "20160922_185803 20160922_212434 ..." set term x11 print 'files = ', files load files start_time=1.e-5 print subdirs nwords = words(subdirs) print 'nwords =', nwords #if(nwords > 13)print 'More than 11 files' #do for [n=1:nwords] {item(n) = word(filenames,n).'/lost_muons.dat'} cx=3 cy=5 ct=12 set ylabel 'Lost at angle [deg]' set xlabel 'Time after injection {/Symbol m}s' set key noenhance print subdirs plot for [i=1:words(subdirs)] word(subdirs, i).'/lost_muons.dat' u 12:($12 > start_time ? $8:1/0) pt 4 not pause -1 plot for [i=1:words(subdirs)] word(subdirs, i).'/lost_muons.dat' u 12:($12 > start_time ? (atan2(column(cy),column(cx))*180./pi):1/0) pt 4 not # plot '20161010_085242/lost_muons.dat' u 12:($12 > 10.e-6 ? (atan2($5,$3)*180./pi):1/0) pause -1 set terminal pdf enhanced fontscale 0.75 size 6.0in, 6.0in outputfile = filename.'.pdf' print outputfile set output outputfile replot #plot for [file in filenames] file.'/Beam_moments_tbt.dat' u ($5/1.e-6):($16) w l t file #plot for [n=1:2] item(n).'/Beam_moments_tbt.dat' u ($5/1.e-6):16 w l t item(n)