| 1 | initial version |
Below is a bit of a hack, but I think it does what you want. I'll keep thinking of other options.
var('x,y,z')
f(x,y)=x^2+3*y^2
levels=[1,2,3,4]
epsilon=0.1
p=plot3d(f(x,y),(x,-2,2),(y,-2,2),color='khaki',opacity=0.7)
for h in levels:
p+=implicit_plot3d(f(x,y)==h,(x,-2,2),(y,-2,2),(z,h,h+epsilon))
show(p)
| 2 | No.2 Revision |
Below is a bit of a hack, but I think it does what you want. I'll keep thinking of other options.
var('x,y,z')
f(x,y)=x^2+3*y^2
levels=[1,2,3,4]
epsilon=0.1
p=plot3d(f(x,y),(x,-2,2),(y,-2,2),color='khaki',opacity=0.7)
for h in levels:
p+=implicit_plot3d(f(x,y)==h,(x,-2,2),(y,-2,2),(z,h,h+epsilon))
show(p)

| 3 | No.3 Revision |
Below is a bit of a hack, but I think it does what you want. I'll keep thinking of other options.
var('x,y,z')
f(x,y)=x^2+3*y^2
levels=[1,2,3,4]
epsilon=0.1
p=plot3d(f(x,y),(x,-2,2),(y,-2,2),color='khaki',opacity=0.7)
for h in levels:
p+=implicit_plot3d(f(x,y)==h,(x,-2,2),(y,-2,2),(z,h,h+epsilon))
show(p)

Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.