Ask Your Question

3d plots without Java

asked 2011-05-17 11:53:54 -0600

v_2e gravatar image

updated 2011-05-22 07:57:55 -0600

Kelvin Li gravatar image

Hello! Is it possible to get a "static" plot of 3D-data? For example, if I state the fixed angles of view and want to get simply a PNG file. Maybe something like the command

gnuplot -e 'set terminal png; set view 80,30; splot "output.txt"'


If it isn't implemented in Sage right now, is it planned? Thanks.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2011-05-17 12:18:51 -0600

benjaminfjones gravatar image

updated 2011-05-18 03:01:16 -0600

kcrisman gravatar image

There is a ray-tracer built into Sage called Tachyon. In the example from your previous question, try:

sage: L = [ (1, 1, 1), (1, 5, 7), (8.8, 0, 3),  (7.5, 1.91, 11.8), (0, 0, 0) ]
sage: point3d(L, viewer='tachyon')


sage: x,y=var('x,y')
sage: plot3d(x^2-y^2, (x,-2,2), (y,-2,2), viewer='tachyon')

Here is the section of the Sage manual: Tachyon

edit flag offensive delete link more


Also, on a somewhat related note, if you want a "dynamic"/interactive plot without Java you can use " viewer='canvas3d' " for an HTML5-based 3d plot.

cswiercz gravatar imagecswiercz ( 2011-05-17 13:27:01 -0600 )edit

Nice! I didn't realize that was available.

benjaminfjones gravatar imagebenjaminfjones ( 2011-05-17 13:30:21 -0600 )edit

Though one should point out that this doesn't work so well with the particular example given in L. See for an example where it is really nice.

kcrisman gravatar imagekcrisman ( 2011-05-17 15:54:16 -0600 )edit

Thanks a lot! I heard something about Tachyon, but didn't think it was as easy! :) I'll play with it.

v_2e gravatar imagev_2e ( 2011-05-17 19:40:12 -0600 )edit

It seems to need a var('x,y') before the plot3d() example in the answer above (it did for me anyhow)

deebs67 gravatar imagedeebs67 ( 2011-05-18 01:01:46 -0600 )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


Asked: 2011-05-17 11:53:54 -0600

Seen: 601 times

Last updated: May 18 '11