|
From: Jon <dev...@gm...> - 2010-11-04 16:25:46
|
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
>
|