From: <lyn...@fr...> - 2007-08-27 07:57:44
|
Thanks for your quick answer Hans-Bernhard Bröker. On 27/08/07 00:53:31, Hans-Bernhard Bröker wrote: > lyn...@fr... wrote: > > That's not exactly surprising. A FIT_LIMIT of 1e-99 is preposterous. I ended up there because gnuplot didn't react to any change. > > > I wonder if it is possible to > >fit just a line in a single log plot? > > Not quite --- because you don't fit to a plot. You fit to data, among > other things, that means that "set log y" has no effect on fits. So you > have to logarithmize the data yourself to get a similar effect: > > set log y > fit log(a)-b*x 'data' using 1:(log($2)) via a, b > plot a*exp(-b*x), 'data' Well if I use: set log y fit log(a)-b*x '< sed "s/ 0/ ?0/g" dosis.dat' using 1:(log($3)) via a, b plot '< sed "s/ 0/ ?0/g" dosis.dat' using 1:3 t "C_2: 1" ls 1 with lp, a * exp (-x*b) I get: gnuplot> load 'dosis_spz_fit.gpl' No data to fit Are my y-values too small for gnuplot log? How comes it's so hard for gnuplot to do something that can be done as a simple line fit?Setting a and b by own calculations the line is close but still so far off that I can fit a better line with my eyes. Is there a way to fit the line by hand interactivly by just rotating and translating in gnuplot or would I have to use inkscape for that? Is there any way I can get a better auto fit? Thanks Lynx __________________________________________________________________ #set logscale y set termoption enhanced a= 5e-8 b= .7 FIT_LIMIT = 1e-9 FIT_MAXITER = 0 #f(x) = a * exp (-x*b) #fit f(x) '< sed "s/ 0/ ?0/g" dosis.dat' using 1:3 via a,b set log y fit log(a)-b*x '< sed "s/ 0/ ?0/g" dosis.dat' using 1:(log($3)) via a, b plot '< sed "s/ 0/ ?0/g" dosis.dat' using 1:3 t "C_2: 1" ls 1 with lp, a * exp (-x*b) ________________________________________________________________________ dosis.dat #Spz diameter/nm I1/A I2/a I3/A I4/A 1 400 2.6e-8 6.6e-9 1.8e-9 1.8e-10 2 350 1.8e-8 4.5e-9 1.2e-9 1.3e-10 3 300 1.3e-8 3.3e-9 8.5e-10 9.1e-11 4 210 6.1e-9 1.7e-9 4.3e-10 4.9e-11 5 140 2.6e-9 6.8e-10 1.8e-10 0 6 95 1.4e-9 4e-10 1e-10 0 7 52 6.3e-10 1.8e-10 5.2e-11 0 8 34 2.4e-10 7e-11 0 0 9 18 9.1e-11 3.3e-11 0 0 10 12 5.2e-11 0 0 0 11 9 3.8e-11 0 0 0 |