Processing math: 100%

First time here? Check out the FAQ!

Ask Your Question
1

3d contour plotting in sage

asked 12 years ago

ebs gravatar image

updated 12 years ago

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?

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
1

answered 12 years ago

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
Preview: (hide)
link

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 ( 12 years ago )

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: 12 years ago

Seen: 1,432 times

Last updated: Jun 16 '12