file = 'vis_45_L300_R300_P0_ScanRhwp_RightHWP_3_inttime_800_20140111_1830' #file = 'vis_45lockedL300R300_LeftHWP_2_inttime_800_20140110_0151' #inttime=800 tit="" #set x2label "Left HWP position" unset x2label #set title "Visibility in the \261 45\260 Basis" unset title set terminal postscript color enhanced "Helvetica" 8 size 9cm,6.77cm set output file . '.eps' #express the offset o interms of the visibility v for a model which fits better f(t) = a*(sin(c*(t-p))**2) + (a/2)*((1-v)/v) v=0.990748 a=2200 c=2*pi/180.0 # FIXED p=-90*-300/600.0+67.5 set border 15 set xtics format "%g" set xtics ("-67.5" -67.5,"-45" -45, "-22.5" -22.5, "0" 0, "22.5" 22.5, "45" 45, "67.5" 67.5) set xtics nomirror #set x2tics 300 #set x2range [-1000:1000] unset x2tics unset x2range unset ytics set xrange[-67.5:67.5] set yrange [0:a+a/20] FIT_LIMIT = 1e-15 set fit errorvariables fit [-67.5:0] f(x) file u (($2/1200)*90):($9):(sqrt($9)) via v,a,p set ylabel "Pairs" set xlabel "HWP angle (\260)" #visibility error #o=(a/2)*((1-v)/v) #error=2*sqrt( ((a_err*a)**2 + (o_err*o)**2) / ((a+o)**4) ) #vis= (a-o)/(a+o) #print "visibility is: ",vis #print "Error is: ", error unset label 1 set encoding iso_8859_1 set label 1 sprintf("Visibility from fit = \n %2.1f \261 %2.1f %",v*100,v_err*100) at -40,500 tc rgb "red" set style line 4 default set style line 4 ps 0.1 lt 1 lc 3 pt 6 lw 1 plot f(x) lt 1 lw 2 title "" , file u (($2/1200)*90):($9):(sqrt($9)) ls 4 w yerrorbars title tit #set terminal windows #plot file u 2:($9) w p lt 1 lw 2 axes x2y1 title "", f(x) lt 1 lw 2 title "" , file u (($2/600)*90):($9) w lt 1 lw 2 title tit