#!/usr/bin/gnuplot # from: http://localhost:8888/notebooks/20200405_ten_km_tsc6NWlocal_tsc5APDremote_common_freq_test_offset_change/60ps_binning_100s_automodel_g2model/Chapter%203.1%20Chopped%20Clocksync%20Demo%20Code-Copy5c.ipynb set terminal postscript eps color enhanced solid font 'Helvetica, 16pt' size 8.6cm, 6cm dl .5 set output 'sample_fits.eps' set multiplot data_auto = 'sample_auto_90s_tacq_experiment.dat' fit_auto = 'sample_auto_90s_tacq_fit.dat' data_g2 = 'sample_g2_3s_tacq_experiment.dat' fit_g2 = 'sample_g2_3s_tacq_fit.dat' point_sz = 0.5 # extract parameters to center the ranges stats data_auto u (auto_t0=$1) every ::0::0 stats data_g2 u (g2_t0=$1) every ::0::0 # peak positions auto_p0 = 103314.017442 g2_p0 = -1285569.3125 # backgrounds auto_bg = 2004.63871 g2_bg = 61.7757151 set lmargin at screen 0.13 set tmargin at screen 0.97 set bmargin at screen 0.6 set xrange [-5:5] # labels set label 1 '(a)' at screen 0.15, 0.91 set label 2 '(b)' at screen 0.15, 0.39 #TOP PLOT set xtics auto # set xtics format ' ' set yrange [1800/auto_bg:3000/auto_bg] set ytics 0.2 # set ytics format '% 4g' set ylabel 'r({/Symbol t})' offset 1.1, 0 set xlabel '{/Symbol t}-{/Symbol t}_{AA} (ns)' offset .5,0.5 plot \ fit_auto using ($1-auto_p0):($2/auto_bg) notitle with lines lw 3 lc 'blue',\ data_auto using ($1-auto_p0):($2/auto_bg):($3/auto_bg) notitle with errorbars lc 'black' pt 6 ps point_sz #BOTTOM PLOT set tmargin at screen 0.44 set bmargin at screen 0.14 set xtics format '%g' set xrange [-5:5] set xlabel '{/Symbol t}-{/Symbol t}_{AB} (ns)' offset .5,.5 unset yrange set ytics 10 set ylabel 'g^{(2)}({/Symbol t})' plot \ fit_g2 using ($1-g2_p0):($2/g2_bg) notitle with lines lw 3 lc 'blue' ,\ data_g2 using ($1-g2_p0):($2/g2_bg):($3/g2_bg) notitle with errorbars lc 'black' pt 6 ps point_sz