set key right bottom

#set size .9,.85

set fit errorvariables
set ylabel "$\\frac{\\Delta \\lambda}{\\mathrm{pm}}$"
set xlabel "$\\frac{B}{\\mathrm{T}}$"

set decimalsign ','
set samples 5000

#set xtic 11
#set ytics 1



f(x) = A*x + B
fit f(x) 'rozstepeni.dat' using 1:2 via A,B
plot 'rozstepeni.dat' using 5:6 lt 3 title '6 A', 'rozstepeni.dat' using 7:8 lt 4 title '8 A',  'rozstepeni.dat' using 1:2 lt 1 title '9 A', 'rozstepeni.dat' using 9:10 lt 5 title '10 A', 'rozstepeni.dat' using 3:4 lt 2 title '12 A',  'rozstepeni.dat' using 11:12 lt 6 title '15,6 A', f(x) title 'teoretická závislost'

set terminal latex
set out "grafrozstepeni.tex"
replot
set out
set term win

set print "fitrozstepeni.txt"
print "   A*(1 - exp(-x/B))"
print A, " +/- ", A_err, ",   rel. chyba ", abs(A_err/A*100), " %"
print B, " +/- ", B_err, ",   rel. chyba ", abs(B_err/B*100), " %"
#print C, " +/- ", C_err, ",   rel. chyba ", abs(C_err/C*100), " %"
set print