set encoding iso_8859_1 set xlabel "r" set ylabel "-ln(H(r))+ln(r^2)" datafile="pmf" grapha="pmfa.eps" graphb="pmfb.eps" Rs=30. lr=2. Rb=12. N=50. f(D)= -pi*(Rs-lr)*((2.*lr-D)*(Rs+Rb-lr+D/2)+(2.*lr-Rs+Rb)*(Rs+Rb)*log((Rs-Rb-D)/(Rs-Rb-2.*lr))) g(x) = f(Rs-Rb-x) h(x) = (x>(Rs-Rb-2*lr) && x<(Rs-Rb)) ? g(x) : 1/0 c1=(N/(4./3.*pi*(Rs-lr)**3)) j(x) = c1*h(x)+b fit [x=(Rs-Rb-2*lr):(Rs-Rb)] j(x) datafile u 1:(\$2+log(\$1**2)) via b c2=(N/(4./3.*pi*((Rs-lr)**3-(Rb+lr)**3))) i(x) = c2*h(x)+a fit [x=(Rs-Rb-2*lr):(Rs-Rb)] i(x) datafile u 1:(\$2+log(\$1**2)) via a set xrange [Rs-Rb-2*lr:Rs-Rb] p datafile u 1:(\$2+log(\$1**2)) title 'Simulation results' ps 2 lw 2, j(x) title 'V_{big} omitted' lw 3, i(x) title 'V_{big} not omitted' lw 3 set terminal postscript eps enhanced color "Helvetica" 26 solid set output grapha pause -1 replot set terminal wxt unset key set xrange [0:Rs-Rb] #set yrange[-4.8:-3.8] p datafile u 1:(\$2+log(\$1**2)) set terminal postscript eps enhanced color "Helvetica" 26 solid set output graphb pause -1 replot # If you want to convert the file to pdf #!epstopdf pmf1a.eps #!epstopdf pmf1as.eps