Ask Your Question
1

3d contour plotting in sage

asked 2012-06-16 01:09:27 -0500

ebs gravatar image

updated 2012-06-16 01:18:50 -0500

It seems there isn't a function in sagemath which can plot contours of a function $f(x, y, z)$ as transparent layers in 3d space like in mayavi.

Is there an alternate way to achieve the same effect in sage?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2012-06-16 02:16:10 -0500

calc314 gravatar image

You might be able to get implicit_plot3d to do it. Maybe something like the following would work for you.

var('x,y,z')
f(x,y,z)=x^2+y^2+z^2/4
p=Graphics()
for k in [1,2,3,4]:
    p+=implicit_plot3d(f(x,y,z)==k,(x,-2,2),(y,-2,2),(z,-5,5),opacity=0.4)
p
edit flag offensive delete link more

Comments

1

I usually use something similar for level surfaces. Note that with the upcoming Jmol upgrade you can plot them first, and adjust their color and opacity to your liking interactively later.

kcrisman gravatar imagekcrisman ( 2012-06-16 08:35:10 -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

Stats

Asked: 2012-06-16 01:09:27 -0500

Seen: 650 times

Last updated: Jun 16 '12