Hi,
The syntax comes from the C programming language. In the example you
are using sprintf that prints to a variable opposed to printf that
prints to the standard output (stdout), usually the screen.
fname is the variable name to receive output
"%s/tmp.plt" is the formatting block, where % followed by a special
symbol indicates the placeholder and the type of arguments to receive,
in this case %s means a string.
dotdir is a variable containing the .gretl folder path (usually in
Linux is hidden).
In the end, fname=.gretl/tmp.plt (if in Linux)
Helio
On Thu, Dec 20, 2012 at 2:05 PM, Qi Shi <qshi.17(a)gmail.com> wrote:
thank Allin very much, could you explain the syntax below
sprintf fname "%s/tmp.plt", dotdir
thanks!
On Mon, Dec 17, 2012 at 9:50 PM, Allin Cottrell <cottrell(a)wfu.edu> wrote:
>
> On Mon, 17 Dec 2012, Qi Shi wrote:
>
> > thanks. but i want to use console, how can i plot a function curve?
>
> Something like this:
>
> <hansl>
> set echo off
> sprintf fname "%s/tmp.plt", dotdir
> outfile @fname --write
> print "plot sin(x)"
> outfile --close
> gnuplot --input="@fname" --output=display
> </hansl>
>
> Allin Cottrell
>
> > On Sun, Dec 16, 2012 at 10:16 PM, Allin Cottrell <cottrell(a)wfu.edu>
> > wrote:
> >
> >> On Sun, 16 Dec 2012, Qi Shi wrote:
> >>
> >>> how to plot a function in gretl, such as y=2+x+x^2?
> >>
> >> See /Tools/Plot a curve. In the box that appears, type the
> >> right-hand side (that is, skip the "y="):
> >>
> >> 2+x+x^2
> >>
> >> You want something that is a valid argument to the "plot" command
in
> >> gnuplot.
> _______________________________________________
> Gretl-users mailing list
> Gretl-users(a)lists.wfu.edu
>
http://lists.wfu.edu/mailman/listinfo/gretl-users
--
shi, qi
_______________________________________________
Gretl-users mailing list
Gretl-users(a)lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users