|
From: Thomas S. <t.s...@fz...> - 2010-11-04 19:31:11
|
the current version of gnuplot is 4.4 versions up to 4.2.6 don't have the 'eval' command. bsmile wrote: > > I might have missed several backslashes. After fixing that, there is still > similar complaints. I still tend to believe that eval command is not > recognized in gnuplot. I tried the test case > > g = 'plot aaa.txt u 1:2 w l' > eval g > > it complains > > gnuplot> eval g > ^ > invalid command > > which seems to support my guess, > > Jon > > > On Thu, Nov 4, 2010 at 11:41 AM, Heeren,Tammo,IRVINE,R&D < > Tam...@al...> wrote: > >> Check how you quoted things. I think the problem is there. >> >> Tammo >> >> -----Original Message----- >> From: Jon [mailto:dev...@gm...] >> Sent: Thursday, November 04, 2010 9:26 AM >> To: Thomas Sefzick >> Cc: gnu...@li... >> Subject: Re: [Gnuplot-info] variable defined from reading a file? >> >> Thanks for the sample code. I tested it and get an error like >> >> if (i==0) eval "plot 'ts.dat' using >> (mu".i."=column(1),sigma".i."=column(2),0/0):(0/0)" >> ^ >> "ts.loop", line 2: invalid command >> >> Seems that the current version of gnuplot does not recognize eval >> command?! >> The version for my gnuplot is 4.2 with patchlevel 3 >> >> I did a google search, but does not lead me anywhere ... >> >> Thanks for further information! >> >> Jon >> >> >> >> On Thu, Nov 4, 2010 at 6:20 AM, Thomas Sefzick <t.s...@fz... >> >wrote: >> >> > >> > plot in a loop using the 'reload' command and store the mu and sigma >> values >> > in variables specific to each sub-plot: >> > >> > file 'ts.plt': >> > >> > ############### >> > i=0 >> > f(x,mu,sigma)=exp(-(x-mu)**2/2/sigma**2)/sqrt(2*pi)/sigma >> > load 'ts.loop' >> > ############### >> > >> > file 'ts.loop': >> > >> > ############### >> > if (i==0) \ >> > eval "plot 'ts.dat' using >> > (mu".i."=column(1),sigma".i."=column(2),0/0):(0/0) >> > every ::".i."::".i." notitle, f(x,mu".i.",sigma".i.")" \ >> > ; else \ >> > eval "replot 'ts.dat' using >> > (mu".i."=column(1),sigma".i."=column(2),0/0):(0/0) every ::".i."::".i." >> > notitle, f(x,mu".i.",sigma".i.")" >> > >> > i=i+1 >> > reread >> > ############### >> > >> > start it with: >> > >> > load 'ts.plt' >> > >> > >> > bsmile wrote: >> > > >> > > Hello, >> > > >> > > So far gnuplot has given me many surprises, and expanded my horizon >> how >> > > much >> > > it can do. Now comes one more thing I am wondering whether gnuplot >> can >> > do. >> > > >> > > For example, I save mu and sigma in a file >> > > >> > > # mu sigma >> > > 0.1 0.1 >> > > 0.1 0.2 >> > > 0.1 0.3 >> > > 0.2 0.1 >> > > 0.2 0.2 >> > > ... >> > > >> > > I want to read the first line and assign them to two variables mu and >> > > sigma, >> > > then plot >> > > >> > > f(x,mu,sigma)=exp(-(x-mu)**2/2/sigma**2)/sqrt(2*pi)/sigma >> > > >> > > and then read the next line and assign to mu and sigma, and plot the >> next >> > > Gaussian distribution again >> > > >> > > ... >> > > >> > > If this can be done, that would give great flexibility to gnuplot, >> > > >> > > Thanks for any advices, >> > > >> > > Sincerely, >> > > Jon >> > > >> > >> ------------------------------------------------------------------------------ >> > > The Next 800 Companies to Lead America's Growth: New Video Whitepaper >> > > David G. Thomson, author of the best-selling book "Blueprint to a >> > > Billion" shares his insights and actions to help propel your >> > > business during the next growth cycle. Listen Now! >> > > http://p.sf.net/sfu/SAP-dev2dev >> > > _______________________________________________ >> > > gnuplot-info mailing list >> > > gnu...@li... >> > > https://lists.sourceforge.net/lists/listinfo/gnuplot-info >> > > >> > > >> > >> > -- >> > View this message in context: >> > >> http://old.nabble.com/variable-defined-from-reading-a-file--tp30129834p30130978.html >> > Sent from the Gnuplot - User mailing list archive at Nabble.com. >> > >> > >> > >> > >> ------------------------------------------------------------------------------ >> > The Next 800 Companies to Lead America's Growth: New Video Whitepaper >> > David G. Thomson, author of the best-selling book "Blueprint to a >> > Billion" shares his insights and actions to help propel your >> > business during the next growth cycle. Listen Now! >> > http://p.sf.net/sfu/SAP-dev2dev >> > _______________________________________________ >> > gnuplot-info mailing list >> > gnu...@li... >> > https://lists.sourceforge.net/lists/listinfo/gnuplot-info >> > >> >> ------------------------------------------------------------------------------ >> The Next 800 Companies to Lead America's Growth: New Video Whitepaper >> David G. Thomson, author of the best-selling book "Blueprint to a >> Billion" shares his insights and actions to help propel your >> business during the next growth cycle. Listen Now! >> http://p.sf.net/sfu/SAP-dev2dev >> _______________________________________________ >> gnuplot-info mailing list >> gnu...@li... >> https://lists.sourceforge.net/lists/listinfo/gnuplot-info >> >> This e-mail (including any attachments) is confidential and may be >> legally >> privileged. If you are not an intended recipient or an authorized >> representative of an intended recipient, you are prohibited from using, >> copying or distributing the information in this e-mail or its >> attachments. >> If you have received this e-mail in error, please notify the sender >> immediately by return e-mail and delete all copies of this message and >> any >> attachments. >> >> Thank you. >> > ------------------------------------------------------------------------------ > The Next 800 Companies to Lead America's Growth: New Video Whitepaper > David G. Thomson, author of the best-selling book "Blueprint to a > Billion" shares his insights and actions to help propel your > business during the next growth cycle. Listen Now! > http://p.sf.net/sfu/SAP-dev2dev > _______________________________________________ > gnuplot-info mailing list > gnu...@li... > https://lists.sourceforge.net/lists/listinfo/gnuplot-info > > -- View this message in context: http://old.nabble.com/variable-defined-from-reading-a-file--tp30129834p30135393.html Sent from the Gnuplot - User mailing list archive at Nabble.com. |