Ask Your Question
1

3d contour plotting in sage

asked 2012-06-16 08:09:27 +0100

ebs gravatar image

updated 2012-06-16 08:18:50 +0100

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 09:16:10 +0100

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 15:35:10 +0100 )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 08:09:27 +0100

Seen: 1,387 times

Last updated: Jun 16 '12