MayaVi

Last updated
Developer(s) Enthought
Initial release2019;6 years ago (2019)
Stable release
4.8.3 [1]   OOjs UI icon edit-ltr-progressive.svg / 16 May 2025;2 months ago (16 May 2025)
Repository
Written in Python, VTK, wxPython/Qt
Operating system Linux, Mac OS X, Windows
Available in English
Type Data visualization
License BSD License
Website docs.enthought.com/mayavi/mayavi/

MayaVi is a scientific data visualizer written in Python, which uses VTK and provides a GUI via Tkinter. MayaVi was developed by Prabhu Ramachandran, is free and distributed under the BSD License. It is cross-platform and runs on any platform where both Python and VTK are available (almost any Unix, Mac OS X, or Windows). MayaVi is pronounced as a single name, "Ma-ya-vee", meaning "magical" in Sanskrit. The code of MayaVi has nothing in common with that of Autodesk Maya or the Vi text editor. [2]

Contents

The latest version of MayaVi, called Mayavi2, is a component of the Enthought suite of scientific Python programs. It differs from the original MayaVi by its strong focus on making an interactive program and a reusable component for 3D plotting in Python. Although it exposes a slightly different interface and API than the original MayaVi, it now has more features. [3] [4]

Major features

Examples

Spherical harmonics

The spherical harmonic function
Y
3
0
(
th
,
ph
)
{\displaystyle Y_{3}^{0}(\theta ,\varphi )} Mayavi spherical harmonics Y 3 0.jpg
The spherical harmonic function
fromnumpyimportlinspace,meshgrid,array,sin,cos,pi,absfromscipy.specialimportsph_harmfrommayaviimportmlabtheta_1d=linspace(0,pi,91)phi_1d=linspace(0,2*pi,181)theta_2d,phi_2d=meshgrid(theta_1d,phi_1d)xyz_2d=array([sin(theta_2d)*sin(phi_2d),sin(theta_2d)*cos(phi_2d),cos(theta_2d)])l=3m=0Y_lm=sph_harm(m,l,phi_2d,theta_2d)r=abs(Y_lm.real)*xyz_2dmlab.figure(size=(700,830))mlab.mesh(r[0],r[1],r[2],scalars=Y_lm.real,colormap="cool")mlab.view(azimuth=0,elevation=75,distance=2.4,roll=-50)mlab.savefig("Y_%i_%i.jpg"%(l,m))mlab.show()

References

  1. "Release 4.8.3".
  2. "MayaVi project page". SourceForge.
  3. "MayaVi2 wiki page".
  4. "MayaVi2 project page".