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).
|
Advanced mlab examples¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Interactive examples¶
Examples showing how to use the interactive features of Mayavi, either via the mayavi2 application, or via specially-crafted dialogs and applications.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 tvtk.tools.mlab with mayavi2.
- 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.
- 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.
- 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.
- 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.
- 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.
- Image cursor filter example
Excample using the UserDefined filter to paint a cross-shaped cursor on data, in order to point out a special position.
- Contour example
This script demonstrates how one can script Mayavi and use its contour related modules.
- Probe filter example
Using the probe filter to visualize a scalar field along an arbitrary surface.
- 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.
- Tvtk segmentation example
Using VTK to assemble a pipeline for segmenting MRI images. This example shows how to insert well-controled custom VTK filters in Mayavi.
- Datasets example
A Mayavi example to show the different data sets. See Data representation in Mayavi for a discussion.
- Delaunay graph example
An example illustrating graph manipulation and display with Mayavi and NetworkX.
- Mlab 3D to 2D example
A script to calculate the projection of 3D world coordinates to 2D display coordinates (pixel coordinates) for a given scene.
- Magnetic field example
An example mixing numerical caculation and 3D visualization of the magnetic field created by an arbitrary number of current loops.
Data interaction examples¶
Examples showing how you can query and interact with the data.
- Pick on surface example
Example showing how to pick data on a surface, going all the way back to the index in the numpy arrays.
- Select red balls example
This example shows how to use a callback to select a red ball amongst white balls.
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.