### Navigation

- index
- next |
- previous |
- Mayavi v3.3.0 documentation »

# Example gallery

## Mlab functions gallery

These are the examples of the mlab plotting functions. They are copied out here for convenience. Please refer to the corresponding section of the user guide for more information ( 3D Plotting functions for numpy arrays).

`plot3d()` | `points3d()` | `imshow()`
`surf()` | `contour_surf()` | `mesh()`
`barchart()` | `triangular_mesh()` | `contour3d()`
`quiver3d()` | `flow()` |

## Advanced mlab examples

| Boy example A script to generate the Mayavi logo: a Boy surface.
| Julia set example An example showing the Julia set displayed as a z-warped surface.
| Surface from irregular data example An example which shows how to plot a surface from data acquired irregularly.
| Canyon example Retrieve radar data from the NASA and plot a view of the Grand Canyon landscape.
| Lorenz example An example displaying the trajectories for the Lorenz system of equations along with the z-nullcline.
| Spherical harmonics example Plot spherical harmonics on the surface of the sphere, as well as a 3D polar plot.
| Tvtk in mayavi example An example of pure TVTK programming to build TVTK objects, which are then added to a Mayavi scene.
| Atomic orbital example An example showing the norm and phase of an atomic orbital: isosurfaces of the norm, with colors displaying the phase.
| Julia set decimation example The Julia set, but with a decimated mesh: unecessary triangles due to the initial grid and not matching the geometry of the Julia set are removed.
| Simple structured grid example An example creating a structured grid data set from numpy arrays using TVTK and visualizing it using mlab.
| Chemistry example In this example, we display the H2O molecule, and use volume rendering to display the electron localization function.
| Wigner example An example in which 3 functions of x and y are displayed with a surf plot, while the z scaling is kept constant, to allow comparison between them.
| Canyon decimation example Use the greedy-terrain-decimator to display a decimated terrain view.
| Magnetic field lines example This example uses the streamline module to display field lines of a magnetic dipole (a current loop).
| Mri example Viewing MRI data with cut plane and iso surface.
| Protein example Visualize a protein graph structure downloaded from the protein database in standard pdb format.
| Flight graph example An example showing a graph display between cities positionned on the Earth surface.

## Interactive examples

Examples showing how to use the interactive features of Mayavi, either via the mayavi2 application, or via specially-crafted dialogs and applications.

| Mlab visual example A very simple example to show how you can use TVTK’s visual module with mlab and create simple animations.
| Mlab traits ui example A simple example of how to use mayavi.mlab inside a traits UI dialog.
| Wx embedding example This example shows to embed a Mayavi view in a wx frame.
| Multiple mlab scene models example Example showing a dialog with multiple embedded scenes.
| Multiple engines example An example to show how you can have multiple engines in one application.
| Wx mayavi embed in notebook example This example show how to embedded Mayavi in a wx notebook.
| Mlab interactive dialog example An example of how to modify the data visualized via an interactive dialog.
| Subclassing mayavi application example This script demonstrates how one can script Mayavi by subclassing the application, create a new VTK scene and create a few simple modules.
| Mayavi traits ui example An example of how to create an almost complete Mayavi UI inside a Traits UI view.
| Compute in thread example This script demonstrates how one can do a computation in another thread and update the mayavi pipeline. It also shows how to create a numpy array data and visualize it as image data using a few modules.
| Poll file example A simple script that polls a data file for changes and then updates the mayavi pipeline automatically.
| Lorenz ui example This example displays the trajectories for the Lorenz system of equations using mlab along with the z-nullcline. It provides a simple UI where a user can change the parameters and the system of equations on the fly. This primarily demonstrates how one can build powerful tools with a UI using Traits and Mayavi.
| Volume slicer example Example of an elaborate dialog showing a multiple views on the same data, with 3 cuts synchronized.

## Advanced visualization examples

Data visualization using the core Mayavi API, object-oriented, and with more fine control than mlab.

- Polydata example

    An example of how to generate a polydata dataset using numpy arrays.

- Offscreen example

    A simple example of how you can use Mayavi without using Envisage or the Mayavi Envisage application and do off screen rendering.

- Surf regular mlab example

    Shows how to view data created by enthought.tvtk.tools.mlab with mayavi2.

- Structured points2d example

    An example of how to generate a 2D structured points dataset using numpy arrays. Also shown is a way to visualize this data with the mayavi2 application.

- Glyph example

    This script demonstrates using the Mayavi core API to add a VectorCutPlane, split the pipeline using a MaskPoints filter and then view the filtered data with the Glyph module.

- Contour contour example

    This example shows how you can produce contours on an IsoSurface.

- Scatter plot example

    An example of plotting scatter points with Mayavi’s core API.

- Structured points3d example

    An example of how to generate a 3D structured points dataset using numpy arrays. Also shown is a way to visualize this data with the mayavi2 application.

- Streamline example

    This script demonstrates how one can script Mayavi’s core API to display streamlines and an iso surface.

- Numeric source example

    This script demonstrates how to create a numpy array data and visualize it as image data using a few modules.

- Contour example

    This script demonstrates how one can script Mayavi and use its contour related modules.

- Unstructured grid example

    A MayaVi example of how to generate an unstructured grid dataset using numpy arrays. Also shown is a way to visualize this data with mayavi2. The script can be run like so:

- Structured grid example

    An example of how to generate a structured grid dataset using numpy arrays. Also shown is a way to visualize this data with the mayavi2 application.

- Datasets example

    A Mayavi example to show the different data sets. See Data structures used by Mayavi for a discussion.

## Misc examples

- Standalone example

    A simple example of how you can use Mayavi without using Envisage or the Mayavi Envisage application.

- Zzz reader example

    This is a simple example that shows how to create a reader factory and register that reader with mayavi.

- Nongui example

    This script demonstrates how one can use the Mayavi application framework without displaying Mayavi’s UI.

- User mayavi example

    Sample Mayavi customization file.

### Navigation

- index
- next |
- previous |
- Mayavi v3.3.0 documentation »