Ask Your Question
1

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

asked 2018-03-23 11:08:02 +0200

winterstein gravatar image

Hello

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));
show(X)

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));
show(X)

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

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-03-23 11:58:07 +0200

slelievre gravatar image

updated 2018-03-23 12:00:12 +0200

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))
X

or maybe one of the following:

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

Comments

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/display_manager.py:590: RichReprWarning: Exception in _rich_repr_ while displaying object: can't convert negative value to size_t
  RichReprWarning,
Graphics3d Object
eric_g gravatar imageeric_g ( 2018-03-23 16:35:30 +0200 )edit

from plot3d? :

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

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 18:42:28 +0200 )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

Stats

Asked: 2018-03-23 11:08:02 +0200

Seen: 1,290 times

Last updated: Mar 23 '18