Here is another strange plot3d behavior (taken from the plot3d
docstring and slightly modified):
sage: plot3d(lambda x, y: x^2 + y^2, (-2,2), (-2,2)) # works as
expected
but
sage: plot3d(lambda x, y: x^2 + y^2, (0,2), (0,2)) # throws an
exception
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/jipsen/.sage/sage_notebook/worksheets/jipsen/8/code/
62.py", line 7, in <module>
plot3d(lambda x, y: x**_sage_const_2 + y**_sage_const_2 ,
(_sage_const_0 ,_sage_const_2 ), (_sage_const_0 ,_sage_const_2 ))
File "/home/jipsen/temp/sage-4.0/local/lib/python2.5/site-packages/
Jinja-1.2-py2.5-linux-i686.egg/", line 1, in <module>
File "/home/jipsen/temp/sage-4.0/local/lib/python2.5/site-packages/
sage/plot/plot3d/plot3d.py", line 195, in plot3d
P = parametric_plot3d.parametric_plot3d(w, urange, vrange, **kwds)
File "/home/jipsen/temp/sage-4.0/local/lib/python2.5/site-packages/
sage/plot/plot3d/parametric_plot3d.py", line 500, in parametric_plot3d
raise ValueError, "plot variables should be distinct, but both are
%s."%(urange[0],)
ValueError: plot variables should be distinct, but both are 0.
Strangly enough the following works ok again:
sage: plot3d(lambda x, y: x^2 + y^2, (0,2), (-0,2))
The error checking is meant to catch problems like
sage: plot3d(sin(x), (x,0,2), (x,0,2))
but the check seems to also be applied to plot3d(f, (a,b), (c,d)).
Regards,
Peter