set fit errorvariables
unset key
#set title "Graf závislosti prodloužení pružiny na jejím zatížení"
set xlabel "frac N"
set ylabel "sigma"

A = 0.0468
B = 0.296
f(x) = A*abs(sin(B*x))
fit f(x) 'tau.dat' using 1:2 via A,B

plot 'tau.dat' using 1:2 lt 1, f(x) lt 2

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

set print "fittau.txt"
print " f(x) = A*abs(sin(B*x)) "
print A, " +/- ", A_err, ",   rel. chyba ", abs(A_err/A*100), " %"
print B, " +/- ", B_err, ",   rel. chyba ", abs(B_err/B*100), " %"
set print

