# set terminal png transparent nocrop enhanced font arial 8 size 420,320 # set output 'fit.13.png' set key right below Right noreverse noinvert enhanced box linetype -2 linewidth 1.000 samplen 4 spacing 1 width 0 height 0 autotitles set title "fit weighted by experimental errors" 0.000000,0.000000 font "" set xlabel "Temperature T [deg Cels.]" 0.000000,0.000000 font "" set ylabel "Density [g/cm3]" 0.000000,0.000000 font "" l(x) = y0 + m*x high(x) = mh*(x-Tc) + dens_Tc lowlin(x) = ml*(x-Tc) + dens_Tc curve(x) = b*tanh(g*(Tc-x)) density(x) = x < Tc ? curve(x)+lowlin(x) : high(x) y0 = 1.06865074176476 m = -0.000943519626922319 ml = -0.0001 mh = -0.0001 dens_Tc = 1.02 Tc = 45 g = 1 b = 0.1 plot 'lcdemo.dat' using 1:2:5 with errorbars, l(x) ## fit l(x) 'lcdemo.dat' using 1:2:5 via y0, m