Ask Your Question

plot3d not displaying - only says "Graphics3d Object"?!

asked 2018-03-23 05:08:02 -0500

winterstein gravatar image


I have a problem, I hope you can help. I'm trying to use plot3d, but instead of drawing a plot, it just prints out the text "Graphics3d Object"

Here is an example Sage snippet that exhibits this problem:

f(x,y) = abs(x*y)
X = plot3d(f, (x,105,72), (y,0.8293,55.8271));

I have seen some functions plot OK -- I can't see a pattern to when it does and doesn't work. For example, this does work:

f(x,y) = abs(x*y)
X = plot3d(f, (x,0,10), (y,0,10));

This bug is repeatable. I am using 64 bit Linux Mint (Ubuntu), and using the notebook in latest Firefox.

Any help much appreciated. Thank you, - Daniel

edit retag flag offensive close merge delete


Welcome to Ask Sage! Thank you for your question!

slelievre gravatar imageslelievre ( 2018-03-23 12:11:30 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2018-03-23 05:58:07 -0500

slelievre gravatar image

updated 2018-03-23 06:00:12 -0500

Maybe because your xmin is bigger than your xmax?

Or because you use a symbolic function?

Try the following:

f = lambda x, y: abs(x*y)
X = plot3d(f, (72, 105), (0.8293, 55.8271))

or maybe one of the following:

show(X, viewer='threejs')
view(X, viewer='threejs')
edit flag offensive delete link more


Yes, xmin > xmax is certainly the reason:

sage: x, y = var('x y')
sage: f(x,y) = abs(x*y)
sage: X = plot3d(f, (x,105,72), (y,0.8293,55.8271))
sage: X
/home/eric/sage/8.2.beta8/local/lib/python2.7/site-packages/sage/repl/rich_output/ RichReprWarning: Exception in _rich_repr_ while displaying object: can't convert negative value to size_t
Graphics3d Object
eric_g gravatar imageeric_g ( 2018-03-23 10:35:30 -0500 )edit

from plot3d? :

 * "urange" - a 2-tuple (u_min, u_max) or a 3-tuple (u, u_min,

But the doc does not state that u_min has to be < u_max. Therefore, we have to fix this by either

  • stating that u_min has to be less than u_max, or
  • inserting something along the lines of

    u_min, u_max=(min(u_min, u_max), max(u_min, u_max))

in plot3d source.

Is that bug already reported ?

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 2018-03-23 12:42:28 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2018-03-23 05:08:02 -0500

Seen: 25 times

Last updated: Mar 23