Plotting issues



Raymond Toy ?????:
> Several issues about plotting follow.
> 
> In bug 552724 there is an example plot:
> 
>         plot2d([5-x^2,x+3],[x,-2,1]); 
> 
> With both openmath, the range of y is limited to -3 to +3 by the plot
> options.  I think this is a bug.  We shouldn't limit the y range unless
> specifically told to.
>

Now it works fine to me. Thanks for the fix.

> 
> If I specify 
> 
>         plot2d([5-x^2],[x,-2,1],[y,-5,5])
> 
> this produces the desired openmath plot.  However, if I want to use
> gnuplot, the command
> 
>         plot2d([5-x^2],[x,-2,1],[y,-5,5,plot_format,gnuplot])
> 
> produces an error because maxima wants just 2 items after y. I think
> this is a bug.  Making plot_format come first fixes this.  I think we
> should really specify the y option as y,[-5,5] instead of y,-5,5.
> Then we get a uniform specification of the option name followed by
> exactly one value of either the value or a list of values.

As far as I understand the general form of plot2d
(and similarly plot3d) is

    plot2d(expression,range,option1,option2,...);

with option having the form [option_name,value1,value2,...].

So it should be

    plot2d([5-x^2],[x,-2,1],[y,-5,5],[plot_format,gnuplot]);

and it actually works. It also works for me with gnuplot.
Maybe make install should take care of mgnuplot and install it somewhere.


> 
> Also, if you use gnuplot, no plot is actually produced.  I think the
> reason is that what maxima writes out includes lines like
> 
>         move x y
> 
> where x and y are numbers.  These aren't valid gnuplot values, so I
> think gnuplot just gives up.  I have a hack to not print these lines,
> and a plot is produced, but I'm not sure that is the right thing.  I
> don't understand why there are those move lines at all.  (A left over
> from PS plotting?)
> 
> Finally, it's impossible for the average person to figure out how to
> use plot2d because describe just says:
> 
>          - Function: PLOT2D (expr,range,...,options,..)
> 
> We need a little bit more here. :-)  I'll try to cook up some docs for
> this.
> 
> I haven't filed any of these a bugs, but if you want me to, I can.  I
> was planning on fixing these soon.
> 
> Ray

Plaing with plot3d I noticed yes another bug

plot3d(1,[x,0,3],[y,0,3]);
plot3d(sin(x),[x,0,3],[y,0,3]);

produce lisp errors. It seems that plot3d require the expression to
have explicit dependence on exactly two plotting range variables.
Notice that

plot2d(1,[x,0,3]);

works well.

Another bad feature. Type in plot3d option results in
lisp error once again.