[SciPy-user] surface plotting

Gael Varoquaux gael.varoquaux@normalesup....
Sun Dec 2 12:07:48 CST 2007


On Sun, Dec 02, 2007 at 12:56:47PM -0500, william ratcliff wrote:
>    Can Mayavi2 be called from within a wxpython application for 3D plotting?

Yes. This has been one of the great additions of this summer. Have a look
at
https://svn.enthought.com/enthought/browser/branches/enthought.mayavi_2.0.3a1/examples/standalone.py
for a demo of how mayavi is integrated in a traits application. As traits
relies on WxPython (althought, there is now a Qt front end), it is trivial to
plug this in a WxPython applictation (ask if you need help).

>    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?

I more and more think of the mayavi engine as an abstraction over tvtk
that allows one to think in terms of data and visualisation rather than
in terms of VTK objects. The mayavi2 application is a GUI around the
mayavi2 engine. The example above exposes the engine without the GUI,
allowing you to use its nice API and features in you own app. Mlab is a
simplied API for Mayavi that tries to mimic pylab/matlab. The calls are
really simple and easy to learn. However, due to a design error on my
side, mlab cannot be used in a standalone way, ie to integrate in an
existing WxPython app. This will be changed, just give me a month or two
(not that there is a huge amount of work, but that I am very busy).

It is much easier to add features to mayavi's mlab than to tvtk's.
Moreover, with mayavi's mlab you can pop up the UI to edit the pipeline
in your own app, you also have the engine API that you can access, and
this is great to update/modify a visualization. I think the big
difference between the two is the presence of the mayavi2 engine, which
give a nice abstraction on the visulization. As a result, mayavi's mlab
already has more features than tvtk's, altought some features of tvtk's
mlab are missing (mainly the ability to run in standalone).

HTH,

Gaël


More information about the SciPy-user mailing list