2008/5/3 Richard Hennessy <rvh2007 at comcast.net>:
> Sorry,
>
> I gave a bad example since plot2d accepts functions inside of a list so you can use makelist. What I need to do is plot functions that cannot be solved for y in terms of x so I have to use implicit's and draw2d which does not work with lists.
>
> (%i25) load(draw);
> -> C:/PROGRA~1/MAXIMA~1.0/share/maxima/5.15.0/share/draw/draw.lisp
>
> (%i26) str1:"draw2d(implicit(x^1-y,x,0,1,y,0,1)";
> -> draw2d(implicit(x^1-y,x,0,1,y,0,1)
>
> (%i27) for i : 2 thru 20 do str1:concat(str1,",implicit(x^",i,"-y,x,0,1,y,0,1)");
> -> done
>
> (%i28) str1:concat(str1, ")")$
>
> (%i29) eval_string(str1);
>
> This code works but I want to use buildq or some other way and not generate the command as a string and then use eval_string. Someone said it can be done and the above way was bad coding practice.
You can use makelist and then apply:
(%i3) makelist(implicit(y^i-x, x, 0, 1, y, 0, 1), i, 2, 4);
(%o3) [implicit(y^2-x,x,0,1,y,0,1),implicit(y^3-x,x,0,1,y,0,1),
implicit(y^4-x,x,0,1,y,0,1)]
(%i4) apply(draw2d, %);
HTH,
--
Andrej