Navigation

  • index
  • modules |
  • next |
  • previous |
  • mayavi 0.0.0 documentation »
  • Example gallery

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()

plot3d.jpg

points3d()

points3d.jpg

imshow()

imshow.jpg

surf()

surf.jpg

contour_surf()

contour_surf.jpg

mesh()

mesh.jpg

barchart()

barchart.jpg

triangular_mesh()

triangular_mesh.jpg

contour3d()

contour3d.jpg

quiver3d()

quiver3d.jpg

flow()

flow.jpg

volume_slice()

volume_slice.jpg

Advanced mlab examples¶

0000

Boy example

A script to generate the Mayavi logo: a Boy surface.

0001

Julia set example

An example showing the Julia set displayed as a z-warped surface.

0002

Bunny example

Viewing Stanford 3D Scanning Repository bunny model

0003

Dragon example

Viewing Stanford 3D Scanning Repository dragon model

0004

Lucy example

Viewing Stanford 3D Scanning Repository lucy model

0005

Custom colormap example

An example showing how a custom colormap (or look up table) can be used for a given object.

0006

Surface from irregular data example

An example which shows how to plot a surface from data acquired irregularly.

0007

Lorenz example

An example displaying the trajectories for the Lorenz system of equations along with the z-nullcline.

0008

Spherical harmonics example

Plot spherical harmonics on the surface of the sphere, as well as a 3D polar plot.

0009

Canyon example

Retrieve radar data from the NASA and plot a view of the Grand Canyon landscape.

0010

Julia set decimation example

The Julia set, but with a decimated mesh: unnecessary triangles due to the initial grid and not matching the geometry of the Julia set are removed.

0011

Simple structured grid example

An example creating a structured grid data set from numpy arrays using TVTK and visualizing it using mlab.

0012

Atomic orbital example

An example showing the norm and phase of an atomic orbital: isosurfaces of the norm, with colors displaying the phase.

0013

Tvtk in mayavi example

An example of pure TVTK programming to build TVTK objects, which are then added to a Mayavi scene.

0014

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.

0015

Canyon decimation example

Use the greedy-terrain-decimator to display a decimated terrain view.

0016

Chemistry example

In this example, we display the H2O molecule, and use volume rendering to display the electron localization function.

0017

Plotting many lines example

This examples shows how many lines can be grouped together in a single object, for convenience and efficiency.

0018

Magnetic field lines example

This example uses the streamline module to display field lines of a magnetic dipole (a current loop).

0019

Mri example

Viewing MRI data with cut plane and iso surface.

0020

Protein example

Visualize a protein graph structure downloaded from the protein database in standard pdb format.

0021

Flight graph example

An example showing a graph display between cities positioned 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.

0101

Mlab traits ui example

A simple example of how to use mayavi.mlab inside a traits UI dialog.

0102

Wx embedding example

This example shows to embed a Mayavi view in a wx frame.

0103

Multiple engines example

An example to show how you can have multiple engines in one application.

0104

Multiple mlab scene models example

Example showing a dialog with multiple embedded scenes.

0105

Superquad with gui example

This example uses MayaVi to show the evolution of a superquadric (http://en.wikipedia.org/wiki/Superquadrics), which are ellipsoidal surfaces parametrised by two parameters, alpha and beta.

0106

Wx mayavi embed in notebook example

This example show how to embedded Mayavi in a wx notebook.

0107

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 the Mayavi application by subclassing the application, create a new scene and create a few simple modules.

0109

Mayavi traits ui example

An example of how to create a UI similar to the complete Mayavi application inside a Traits UI view.

0110

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.

0111

Qt embedding example

This example demonstrates using Mayavi as a component of a large Qt application.

0112

Adjust cropping extents example

A custom dialog to adjust the parameters of a GeometryFilter to crop data points.

0113

Poll file example

A simple script that polls a data file for changes and then updates the mayavi pipeline automatically.

0114

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.

0115

Volume slicer example

Example of an elaborate dialog showing a multiple views on the same data, with 3 cuts synchronized.

0116

Coil design application example

An full-blown application demoing a domain-specific usecase with Mayavi: interactive design of coils.

0117

Volume slicer advanced example

An efficient implementation of the triple-plane view showing 3 cut planes on volumetric data, and side views showing each cut, with a cursor to move the other cuts.

Advanced visualization examples¶

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

0200

Multi block example

0201

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.

0203

Surf regular mlab example

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

0204

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.

0205

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.

0206

Contour contour example

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

0207

Scatter plot example

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

0208

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.

0209

Numeric source example

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

0210

Streamline example

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

0211

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.

0212

Contour example

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

0213

Probe filter example

Using the probe filter to visualize a scalar field along an arbitrary surface.

0214

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:

0215

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.

0216

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.

0218

Delaunay graph example

An example illustrating graph manipulation and display with Mayavi and NetworkX.

0219

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.

0220

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.

0300

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.

0301

Select red balls example

This example shows how to use a callback to select a red ball amongst white balls.

0302

Normal flipping stl example

This example shows how to read a stl file and flip it’s normals.

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.

Logo of mayavi

Table of Contents

  • Example gallery
    • Mlab functions gallery
    • Advanced mlab examples
    • Interactive examples
    • Advanced visualization examples
    • Data interaction examples
    • Misc examples

Previous topic

Miscellaneous

Next topic

Boy example

This Page

  • Show Source

Quick search

Navigation

  • index
  • modules |
  • next |
  • previous |
  • mayavi 0.0.0 documentation »
  • Example gallery
© Copyright Enthought, Inc.. Created using Sphinx 9.1.0.