From: Thomas S. <t.s...@fz...> - 2007-08-28 13:41:02
|
> And what would be the most elegant way to cope with the titels containing > the fit parameters? The first file below is what I want but done clumsy. > After that comes > my reread attempt I got stuck on. How should I handel the third case the > line of which > is missing? use this as 'dosis_single_fit.gpl': c_p= c_p + 1 c_l= c_p + 2 set yrange [-27.63:-16.22] fit log(a)-b*x '< sed "s/ 0/ ?0/g" dosis.dat' using 1:(log(column(c_l))) via a, b set key left at graph 0.5, graph 1.0-c_p*0.1 set yrange [1e-12:9e-8] ptitle(a,b) = sprintf("%e * exp(-x*%e)",a,b) plot '< sed "s/ 0/ ?0/g" dosis.dat' using 1:c_l t "C_2: $c_p" ls c_p with lp, a * exp (-x*b) title ptitle(a,b) lt c_p if (c_p < 4) reread you need to adjust the factor in 'set key...' a little bit, and the format string inside the 'sprintf' function. lynx.abraxas wrote: > > On 27/08/07 03:40:51, Thomas Sefzick wrote: >> >> > 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 >> http://www.nabble.com/file/p12344733/dosis.gif >> > I figured out that my "set yrange [1e-12:9e-8]" before the fit causes the > error. Is it in > intended that yrange effects fit? > The only thing left now is how to get the multiplot have nice axes; with > reread they get > overpainted. And what would be the most elegant way to cope with the > titels containing > the fit parameters? The first file below is what I want but done clumsy. > After that comes > my reread attempt I got stuck on. How should I handel the third case the > line of which > is missing? > > Thanks a lot for Your help > Lynx > > ________________________________________________ > > set output "Dosis.png" > set style line 1 lt 1 lw 2 > set style line 2 lt 2 lw 2 > set style line 3 lt 3 lw 2 > set style line 4 lt 4 lw 2 > #set terminal png font FreeSans 14 crop size 700,500 > set xrange [1:12] > set xtics 1,1,11 > set label 1 'Spz' at graph 0.97, graph -.05 > set mytics 10 > set label 2 'I[A]' at graph -0.05, graph 0.99 > set key right top # Left reverse > set termoption enhanced > a= 5e-8 > c= 5e-8 > e= 5e-8 > f= .8 > g= 5e-8 > b= .7 > FIT_LIMIT = 1e-9 > FIT_MAXITER = 0 > set log y > titel(s,n,t,m) = sprintf("%s= %.1e; %s= %.1e", s, n, t, m) > fit log(a)-b*x '< sed "s/ 0/ ?0/g" dosis.dat' using 1:(log($3)) via a, b > fit log(c)-d*x '< sed "s/ 0/ ?0/g" dosis.dat' using 1:(log($4)) via c, d > fit log(e)-f*x '< sed "s/ 0/ ?0/g" dosis.dat' using 1:(log($5)) via e, f > fit log(g)-h*x '< sed "s/ 0/ ?0/g" dosis.dat' using 1:(log($6)) via g, h > set yrange [1e-12:9e-8]#not before fit!!! > plot a * exp (-x*b) t titel("a",a,"b",b) lt 1, c * exp (-x*d) t > titel("a",c,"b",d) lt > 2, e * exp (-x*f) t titel("a",e,"b",f) lt 3, g * exp (-x*h) t > titel("a",g,"b",h) lt 4, > '< sed "s/ 0/ ?0/g" dosis.dat' using 1:3 t "C_2: 1" ls 1 with lp, '< sed > "s/ 0/ ?0/g" > dosis.dat' using 1:4 t "C_2: 2" ls 2 with lp, '< sed "s/ 0/ ?0/g" > dosis.dat' using 1:5 > t "C_2: 3" ls 3 with lp, '< sed "s/ 0/ ?0/g" dosis.dat' using 1:6 t "C_2: > 4" ls 4 with lp > > _______________________________________________________ > > > c_p= c_p + 1 > c_l= c_p + 2 > fit log(a)-b*x '< sed "s/ 0/ ?0/g" dosis.dat' using 1:(log(column(c_l))) > via a, b > #set yrange [1e-12:9e-8]#not before fit!!! > plot '< sed "s/ 0/ ?0/g" dosis.dat' using 1:c_l t "C_2: $c_p" ls c_p with > lp, a * exp (- > x*b) lt c_p > if (c_p < 6) reread > > ______________________________________________________ > > > set output "Dosis.png" > set style line 1 lt 1 lw 2 > set style line 2 lt 2 lw 2 > set style line 3 lt 3 lw 2 > set style line 4 lt 4 lw 2 > #set terminal png font FreeSans 14 crop size 600,400 > set xrange [1:12] > set xtics 1,1,11 > set label 1 'Spz' at graph 0.97, graph -.05 > set mytics 10 > set label 2 'I[A]' at graph -0.05, graph 0.99 > set key right top Left reverse > set termoption enhanced > a= 5e-8 > b= .7 > FIT_LIMIT = 1e-9 > FIT_MAXITER = 0 > set log y > c_p= 0 > set multiplot > call 'dosis_single_fit.gpl' 'dosis.dat' > unset multiplot > > > > ------------------------------------------------------------------------- > 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 > > -- View this message in context: http://www.nabble.com/How-to-fit-a-line-in-log-plot-or-how-to-help-converge-exp-better-tf4332385.html#a12368100 Sent from the Gnuplot - User mailing list archive at Nabble.com. |