Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: sfeam Newsgroups: comp.graphics.apps.gnuplot Subject: Re: display the fit function and/or fit parameters in the chart area? Followup-To: comp.graphics.apps.gnuplot Date: Sun, 20 May 2012 21:42:34 -0700 Organization: gnuplot development team Lines: 32 Message-ID: References: <29384440.3636.1335790067323.JavaMail.geo-discussion-forums@vbbfk16> <18741148.475.1336706854974.JavaMail.geo-discussion-forums@vbq19> <10fad3e4-1d89-4c17-b03a-6dac787ef47a@pr7g2000pbb.googlegroups.com> Reply-To: sfeam@users.sourceforge.net Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit Injection-Date: Mon, 21 May 2012 04:42:34 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="3mhAfh4CeAIeL3OKnPexDA"; logging-data="11150"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1866t7fNHYlAQea2x5Ih/Le" User-Agent: KNode/4.4.9 Cancel-Lock: sha1:jShUaPdgNO1Vb5ndt6vfkiGuwl4= Xref: csiph.com comp.graphics.apps.gnuplot:1133 Nicholas Musolino wrote: > On May 10, 11:27 pm, TonyG wrote: >> On Monday, April 30, 2012 8:47:47 AM UTC-4, TonyG wrote: >> > How to automate the process, instead of having to insert copied >> > strings? >> >> Is it possible...? So far, no peep from anybody... > > See second item on this page. > http://t16web.lanl.gov/Kawano/gnuplot/misc4-e.html > > Copied and pasted from that site: > > gnuplot> f(x)=a*x*x+b*x+c > gnuplot> fit f(x) 'test.dat' using 1:2:3 via a,b,c > gnuplot> set label 1 "Y=AX^2+BX+C" at 11,1225 > gnuplot> set label 2 "A = %g", a at 12,1200 > gnuplot> set label 3 "B = %g", b at 12,1180 > gnuplot> set label 4 "C = %g", c at 12,1160 > gnuplot> plot f(x),'test.dat' using 1:2:3 with yerr That syntax is very out of date. I'm not sure it will work any more. Use string variables and string functions instead. That is, instead of set label 2 "A = %g", a at 12,1200 you want set label 2 sprintf("A = %4.2f",a) at 12, 1200 and so on. Ethan