|
From: Thomas S. <t.s...@fz...> - 2007-08-27 10:40:58
|
> gnuplot> load 'dosis_spz_fit.gpl' > No data to fit with the data and the script you provide i'm not able to reproduce your problem. i'm using gnuplot 4.0 and gnuplot 4.3. in both versions the fit converges after 10 iterations: http://www.nabble.com/file/p12344733/fit.log fit.log=20 http://www.nabble.com/file/p12344733/dosis.gif=20 lynx.abraxas wrote: >=20 > Thanks for your quick answer Hans-Bernhard Br=C3=B6ker. >=20 > On 27/08/07 00:53:31, Hans-Bernhard Br=C3=B6ker wrote: >> lyn...@fr... wrote: >> >> That's not exactly surprising. A FIT_LIMIT of 1e-99 is preposterous. >=20 > I ended up there because gnuplot didn't react to any change. >=20 >> >> > 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' >=20 > Well if I use: >=20 > 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,= =20 > a * exp (-x*b) >=20 > I get: > gnuplot> load 'dosis_spz_fit.gpl' > No data to fit >=20 > Are my y-values too small for gnuplot log? >=20 > How comes it's so hard for gnuplot to do something that can be done = =20 > as a > simple line fit?Setting a and b by own calculations the line is clos= e > but > still so far off that I can fit a better line with my eyes. Is there a= =20 > way > to fit the line by hand interactivly by just rotating and > translating in > gnuplot or would I have to use inkscape for that? >=20 > Is there any way I can get a better auto fit? >=20 > Thanks > Lynx >=20 > __________________________________________________________________ >=20 > #set logscale y > set termoption enhanced > a=3D 5e-8 > b=3D .7 > FIT_LIMIT =3D 1e-9 > FIT_MAXITER =3D 0 > #f(x) =3D 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) >=20 > ________________________________________________________________________ >=20 > 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 >=20 >=20 >=20 > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Gnuplot-info mailing list > Gnu...@li... > https://lists.sourceforge.net/lists/listinfo/gnuplot-info >=20 >=20 --=20 View this message in context: http://www.nabble.com/How-to-fit-a-line-in-lo= g-plot-or-how-to-help-converge-exp-better-tf4332385.html#a12344733 Sent from the Gnuplot - User mailing list archive at Nabble.com. |