You can use any variable you like as your parameter, as long as you use the
gnuplot "set dummy" command. But I was initially wrong: you do need to pass
functions to plot 2d; for example:
(%i1) x(s):=cos(s);
(%i2) y(s):=sin(3*s);
(%i3) plot2d([parametric,x(s),y(s),[s,0,2*%pi]],[gnuplot_preamble,"set dummy
s"],[nticks,180]);
It's up to you whether you want to go to this bother, or just use t as your
parameter.
Alasdair
On 4/5/07, Jaime E. Villate <villate at fe.up.pt> wrote:
>
> On Wed, 2007-04-04 at 11:05 -0300, Zoho Vignochi wrote:
> > > Try:
> > > plot2d([parametric,x, y,[s,0,1]],[gnuplot_preamble,"set dummy s"]);
>
> that will not work because plot2d will only pass numbers to gnuplot.
> It will not pass the symbolic expressions you entered.
>
> > I changed the code to create lists of x and y then graph the output as
> > a
> > set of discrete points. A suboptimal technique I am sure but I could
> > not
> > get plot2d to evaluate my functions.
> As Robert Dodier told you, you needed to do 2 simple things to make
> the parametric plot2d work: replace s by t, and give expressions to
> plot2d, rather than lists. Look at this example:
>
> (%i1) x: [cos(s)]$
> (%i2) y: [sin(s)]$
> (%i5) plot2d([parametric,subst(t,s,x[1]),subst(t,s,y[1]),[t,0,2*%pi]])$
>
> You might want to use option nticks to improve the result.
> Regards,
> Jaime
>
>
>