ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sat, 16 Jun 2012 08:35:10 -05003d contour plotting in sagehttp://ask.sagemath.org/question/9081/3d-contour-plotting-in-sage/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](http://docs.enthought.com/mayavi/mayavi/auto/mlab_helper_functions.html#mayavi.mlab.contour3d).
Is there an alternate way to achieve the same effect in sage?Sat, 16 Jun 2012 01:09:27 -0500http://ask.sagemath.org/question/9081/3d-contour-plotting-in-sage/Answer by calc314 for <p>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 <a href="http://docs.enthought.com/mayavi/mayavi/auto/mlab_helper_functions.html#mayavi.mlab.contour3d">mayavi</a>.</p>
<p>Is there an alternate way to achieve the same effect in sage?</p>
http://ask.sagemath.org/question/9081/3d-contour-plotting-in-sage/?answer=13715#post-id-13715You 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)
pSat, 16 Jun 2012 02:16:10 -0500http://ask.sagemath.org/question/9081/3d-contour-plotting-in-sage/?answer=13715#post-id-13715Comment by kcrisman for <p>You might be able to get <code>implicit_plot3d</code> to do it. Maybe something like the following would work for you.</p>
<pre><code>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
</code></pre>
http://ask.sagemath.org/question/9081/3d-contour-plotting-in-sage/?comment=19584#post-id-19584I 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.Sat, 16 Jun 2012 08:35:10 -0500http://ask.sagemath.org/question/9081/3d-contour-plotting-in-sage/?comment=19584#post-id-19584