Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Rightclick on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
From: Luke <hazelnusse@gm...>  20100915 19:02:53
Attachments:
Message as HTML

I have a function of three variables and am interested in plotting the zero level surface: f(x,y,z) = 0 Is there a simple way to plot this level surface in 3D without having to resort to meshing up x and y, and solving for the z that satisfies the equation? I can do this, but it gets messy because there are anywhere from 0 to 2 solutions to the equation for each point in the xy plane. The mplot3d examples all seem to calculate the zdata simply from simple functions of x and y. Thanks, ~Luke 
From: Daπid <davidmenhur@gm...>  20100916 03:29:13

I think you can make it with pyplot.contourf() and the argument V http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.contour "contour(Z,V) contour(X,Y,Z,V) draw contour lines at the values specified in sequence V" On Wed, Sep 15, 2010 at 9:02 PM, Luke <hazelnusse@...> wrote: > I have a function of three variables and am interested in plotting the zero > level surface: > f(x,y,z) = 0 > Is there a simple way to plot this level surface in 3D without having to > resort to meshing up x and y, and solving for the z that satisfies the > equation? I can do this, but it gets messy because there are anywhere from > 0 to 2 solutions to the equation for each point in the xy plane. > The mplot3d examples all seem to calculate the zdata simply from simple > functions of x and y. > Thanks, > ~Luke >  > Start uncovering the many advantages of virtual appliances > and start using them to simplify application deployment and > accelerate your shift to cloud computing. > http://p.sf.net/sfu/novellsfdev2dev > _______________________________________________ > Matplotlibusers mailing list > Matplotlibusers@... > https://lists.sourceforge.net/lists/listinfo/matplotlibusers > > 
From: Dale Lukas Peterson <hazelnusse@gm...>  20100918 00:49:19

David, I'm not sure I understand how I would make use of my function then. My function needs to be evaluated over a 3d mesh (x, y, and z) , and then the level surfaces (not contour lines) calculated. I guess I could treat z as a parameter, then plot the zero level contour lines of my function for a discrete number of z values, but then I would need to adjust the height that each countour line is plotted at when I do the 3d plot. This still would only give bunch of vertically stacked contour lines, rather than a nice smooth 3d surface. If I'm misunderstanding what you meant, perhaps you could point me to an example of something that makes a level surface of a function of 3 (not 2) variables? Thanks, ~Luke On Thu, Sep 16, 2010 at 05:28:47AM +0200, Daπid wrote: > I think you can make it with pyplot.contourf() and the argument V > > http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.contour > > "contour(Z,V) > contour(X,Y,Z,V) > > draw contour lines at the values specified in sequence V" > > On Wed, Sep 15, 2010 at 9:02 PM, Luke <hazelnusse@...> wrote: > > I have a function of three variables and am interested in plotting the zero > > level surface: > > f(x,y,z) = 0 > > Is there a simple way to plot this level surface in 3D without having to > > resort to meshing up x and y, and solving for the z that satisfies the > > equation? I can do this, but it gets messy because there are anywhere from > > 0 to 2 solutions to the equation for each point in the xy plane. > > The mplot3d examples all seem to calculate the zdata simply from simple > > functions of x and y. > > Thanks, > > ~Luke > >  > > Start uncovering the many advantages of virtual appliances > > and start using them to simplify application deployment and > > accelerate your shift to cloud computing. > > http://p.sf.net/sfu/novellsfdev2dev > > _______________________________________________ > > Matplotlibusers mailing list > > Matplotlibusers@... > > https://lists.sourceforge.net/lists/listinfo/matplotlibusers > > > > 
From: Fernando Perez <fperez.net@gm...>  20100918 02:09:06

Hi Luke, On Fri, Sep 17, 2010 at 5:49 PM, Dale Lukas Peterson <hazelnusse@...> wrote: > > I'm not sure I understand how I would make use of my function then. > My function needs to be evaluated over a 3d mesh (x, y, and z) , and then the > level surfaces (not contour lines) calculated. I guess I could treat > z as a parameter, then plot the zero level contour lines of my function for > a discrete number of z values, but then I would need to adjust the > height that each countour line is plotted at when I do the 3d plot. > This still would only give bunch of vertically stacked contour > lines, rather than a nice smooth 3d surface. > > If I'm misunderstanding what you meant, perhaps you could point me > to an example of something that makes a level surface of a function > of 3 (not 2) variables? You're looking for an isosurface; as far as I know matplotlib does not have isosurface modules, only 2d contours embedded in 3d (such as those illustrated in http://matplotlib.sourceforge.net/examples/mplot3d/contourf3d_demo.html). VTK does have powerful isosurface capabilities, nicely exposed by mayavi: http://code.enthought.com/projects/mayavi/docs/development/html/mayavi/auto/mlab_helper_functions.html#contour3d If the mlab helper isn't sufficient for you, you can create directly VTK isosurfaces, the heart example is a good point to start learning: http://code.enthought.com/projects/mayavi/docs/development/html/mayavi/example_heart.html Regards, f 
From: Jason Grout <jasonsage@cr...>  20100918 03:58:17

On 9/17/10 9:08 PM, Fernando Perez wrote: > Hi Luke, > > On Fri, Sep 17, 2010 at 5:49 PM, Dale Lukas Peterson > <hazelnusse@...> wrote: >> >> I'm not sure I understand how I would make use of my function then. >> My function needs to be evaluated over a 3d mesh (x, y, and z) , and then the >> level surfaces (not contour lines) calculated. I guess I could treat >> z as a parameter, then plot the zero level contour lines of my function for >> a discrete number of z values, but then I would need to adjust the >> height that each countour line is plotted at when I do the 3d plot. >> This still would only give bunch of vertically stacked contour >> lines, rather than a nice smooth 3d surface. >> >> If I'm misunderstanding what you meant, perhaps you could point me >> to an example of something that makes a level surface of a function >> of 3 (not 2) variables? > > You're looking for an isosurface; as far as I know matplotlib does not > have isosurface modules, only 2d contours embedded in 3d (such as > those illustrated in > http://matplotlib.sourceforge.net/examples/mplot3d/contourf3d_demo.html). > > VTK does have powerful isosurface capabilities, nicely exposed by mayavi: > > http://code.enthought.com/projects/mayavi/docs/development/html/mayavi/auto/mlab_helper_functions.html#contour3d Sage will also do this sort of thing, though it's not as powerful as VTK/Mayavi in this functionality: http://www.sagemath.org/doc/reference/sage/plot/plot3d/implicit_plot3d.html Here are lots of sheets on sagenb.org that use implicit_plot3d somewhere: http://sagenb.org/pub/?typ=pub&search=implicit_plot3d Thanks, Jason 