bc = 0.5*log(1.0+sqrt(2.0));
set fit errorvariables
set macros
set key top left
bcc = "0.440687" # bc with accuracy calculated in data file all
set xtics (40,60,80,100,140,200,300,400,500)
set term qt enhanced
unset log
set log x
set xlabel "L"
set ylabel "c({/Symbol b}_c,L)"
gmacro = "\"<grep '^e' all|grep ' ".bcc." ' \""
plot [30:600] @gmacro u 2:6:7 w e notit

#------------------------------------
g=1.75;c=0.03;
f(x) = c *log(x)+g
fit [30:110] f(x) @gmacro u 2:6:7 via c,g
c1 = c; c1_err = c_err; g1 = g; g1_err = g_err; f1(x) = c1*log(x)+(g1)
replot f1(x) t "40-100"
#------------------------------------
g=1.75;c=0.03;
f(x) = c *log(x)+g
fit [130:510] f(x) @gmacro u 2:6:7 via c,g
c2 = c; c2_err = c_err; g2 = g; g2_err = g_err; f2(x) = c2*log(x)+(g2)
replot f2(x) t "140-500"
#------------------------------------
g=1.75;c=0.03;
f(x) = c *log(x)+g
fit [10:510] f(x) @gmacro u 2:6:7 via c,g
c3 = c; c3_err = c_err; g3 = g; g3_err = g_err; f3(x) = c3*log(x)+(g3)
replot f3(x) t "40-500"

set term post enha eps color 24
set out "fss_scale_alpha.eps"
plot [30:600] @gmacro u 2:6:7 w e notit, \
      f1(x) notit
set out
set term  qt enha
set xtics autofreq

print sprintf("c1 = %.3f+/-%.3f c2 = %.3f+/-%.3f c3 = %.3f+/-%.3f\n",c1,c1_err,c2,c2_err,c3,c3_err)
#  ---------------------------------------------------------------------
#  Copyright by Konstantinos N. Anagnostopoulos (2004-2014)
#  Physics Dept., National Technical University,
#  konstant@mail.ntua.gr, www.physics.ntua.gr/~konstant
#  
#  This program is free software: you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation, version 3 of the License.
#  
#  This program is distributed in the hope that it will be useful, but
#  WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
#  General Public License for more details.
#  
#  You should have received a copy of the GNU General Public Liense along
#  with this program.  If not, see <http://www.gnu.org/licenses/>.
#  -----------------------------------------------------------------------
