[SciPy-user] surface plotting

william ratcliff william.ratcliff at gmail.com
Sun Dec 2 12:56:47 EST 2007


Can Mayavi2 be called from within a wxpython application for 3D plotting?
At one point I did this with tvtk (using pyface, etc), but not with mayavi.
How different is the mlab within tvtk from that in mayavi2?

Thanks,
William


On Dec 2, 2007 11:49 AM, Gael Varoquaux <gael.varoquaux at normalesup.org>
wrote:

> On Sat, Dec 01, 2007 at 10:24:42PM +0530, Prabhu Ramachandran wrote:
> > Unfortunately, these still use tvtk's mlab which is lower level and not
> > as powerful as mayavi's new mlab.
>
> > The best docs for that are here:
>
> >   https://svn.enthought.com/enthought/attachment/wiki/MayaVi/mlab.pdf
>
>
> Quickly, you can have a feeling of how to plot surface using mlab by
> folliwing these steps:
>
> run "ipython -wthread"
>
> execute the following python code:
>
> +++++++++++++++++++++++++++++++++++++++
> In [1]: from enthought.mayavi.tools import mlab as M
> Set Envisage to use the workbench UI: True
> Set Envisage to use the workbench UI: True
>
> In [2]: from scipy import *
>
> In [3]: X, Y = mgrid[-1:1:50j, -1:1:50j]
>
> In [4]: Z = cos(4*(X**2+Y**2))
>
> In [5]: M.surf(X, Y, Z)
> +++++++++++++++++++++++++++++++++++++++
>
>
> This will bring up a Mayavi2 window with the surface plotted. The mlab
> API is similar to matplotlib's pylab, so you should feel quite familiar
> with it. It is still young and I haven't had time to put as much work as
> I would like in it. Documentation is lacking, but the docstrings are
> quite good. Just reading "help(M)" in the example above should hopefully
> give you an idea of the possbilities. The docs pointed to by Prabhu
> should also be helpful.
>
> HTH,
>
> Gaël
> _______________________________________________
> SciPy-user mailing list
> SciPy-user at scipy.org
> http://projects.scipy.org/mailman/listinfo/scipy-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20071202/5b184547/attachment.html>


More information about the SciPy-User mailing list