Examples#

Here is a gallery of several examples demonstrating what PyVista can do!

All of these examples are live and available on MyBinder.

Launch on Binder

Mesh Creation#

These examples demo how to read various file types into PyVista mesh objects, create meshes from NumPy arrays, and how to create primitive geometric objects like spheres, arrows, cubes, ellipsoids and more! Once a mesh is loaded, it is ready for plotting with just a few lines of code - explore these examples to get started with using PyVista for your data.

Creating an Explicit Structured Grid

Creating an Explicit Structured Grid

Creating an Explicit Structured Grid
Geometric Objects

Geometric Objects

Geometric Objects
Create a Kochanek Spline

Create a Kochanek Spline

Create a Kochanek Spline
Parametric Geometric Objects

Parametric Geometric Objects

Parametric Geometric Objects
Pixel Art of ALIEN MONSTERS

Pixel Art of ALIEN MONSTERS

Pixel Art of ALIEN MONSTERS
Platonic Solids

Platonic Solids

Platonic Solids
Create Point Cloud

Create Point Cloud

Create Point Cloud
Create a PointSet

Create a PointSet

Create a PointSet
Create PolyData

Create PolyData

Create PolyData
Triangle Strips

Triangle Strips

Triangle Strips
Unstructured Grid with Polyhedra

Unstructured Grid with Polyhedra

Unstructured Grid with Polyhedra
Creating a Spline

Creating a Spline

Creating a Spline
Creating a Structured Surface

Creating a Structured Surface

Creating a Structured Surface
Drape 2D Surface From Line

Drape 2D Surface From Line

Drape 2D Surface From Line
Create Triangulated Surface

Create Triangulated Surface

Create Triangulated Surface
Plot Truss-like FEA Solution with Cylinders

Plot Truss-like FEA Solution with Cylinders

Plot Truss-like FEA Solution with Cylinders
Creating a Uniform Grid

Creating a Uniform Grid

Creating a Uniform Grid
Creating an Unstructured Grid

Creating an Unstructured Grid

Creating an Unstructured Grid
Linear Cells

Linear Cells

Linear Cells
Working with glTF Files

Working with glTF Files

Working with glTF Files
Working with VRML Files

Working with VRML Files

Working with VRML Files
Read FEniCS/Dolfin Meshes

Read FEniCS/Dolfin Meshes

Read FEniCS/Dolfin Meshes
Load and Plot from a File

Load and Plot from a File

Load and Plot from a File
Read Image Files

Read Image Files

Read Image Files
Parallel Files

Parallel Files

Parallel Files
Load data using a Reader

Load data using a Reader

Load data using a Reader
Terrain Following Mesh

Terrain Following Mesh

Terrain Following Mesh
Wrapping Other Objects

Wrapping Other Objects

Wrapping Other Objects

Filtering#

These examples show case various mesh analysis and filtering routines present in the Filters module. Explore these demos to perform tasks such as:

  • Slicing and cutting meshes

  • Computing mesh properties like volume, area, and surface normals

  • Mesh decimation

  • Extract regions of one mesh using another mesh’s surface

  • Ray tracing through surface meshes

  • Resampling and interpolating scalar/vector values across meshes

  • Integrating a vector field to generate streamlines

  • Smoothing surfaces

Boolean Operations

Boolean Operations

Boolean Operations
Extract Cell Centers

Extract Cell Centers

Extract Cell Centers
Clipping with a Surface

Clipping with a Surface

Clipping with a Surface
Clipping with Planes & Boxes

Clipping with Planes & Boxes

Clipping with Planes & Boxes
Collision

Collision

Collision
Computing Surface Normals

Computing Surface Normals

Computing Surface Normals
Volumetric Analysis

Volumetric Analysis

Volumetric Analysis
Connectivity

Connectivity

Connectivity
Contouring

Contouring

Contouring
Decimation

Decimation

Decimation
Distance Between Two Surfaces

Distance Between Two Surfaces

Distance Between Two Surfaces
Extract Cells Inside Surface

Extract Cells Inside Surface

Extract Cells Inside Surface
Extract Edges

Extract Edges

Extract Edges
Extract Surface

Extract Surface

Extract Surface
Extrude Rotation

Extrude Rotation

Extrude Rotation
Extrude Trim

Extrude Trim

Extrude Trim
Marching Cubes

Marching Cubes

Marching Cubes
Gaussian Smoothing

Gaussian Smoothing

Gaussian Smoothing
Geodesic Paths

Geodesic Paths

Geodesic Paths
Plotting Glyphs (Vectors or PolyData)

Plotting Glyphs (Vectors or PolyData)

Plotting Glyphs (Vectors or PolyData)
Table of Glyphs

Table of Glyphs

Table of Glyphs
Compute Gradients of a Field

Compute Gradients of a Field

Compute Gradients of a Field
Fast Fourier Transform with Perlin Noise

Fast Fourier Transform with Perlin Noise

Fast Fourier Transform with Perlin Noise
Fast Fourier Transform

Fast Fourier Transform

Fast Fourier Transform
Integrate Data

Integrate Data

Integrate Data
Interpolating

Interpolating

Interpolating
Computing Mesh Quality

Computing Mesh Quality

Computing Mesh Quality
Ray Tracing

Ray Tracing

Ray Tracing
Project to a Plane

Project to a Plane

Project to a Plane
Reflect Meshes

Reflect Meshes

Reflect Meshes
Resampling

Resampling

Resampling
Rotations

Rotations

Rotations
Sample Function: Perlin Noise in 2D

Sample Function: Perlin Noise in 2D

Sample Function: Perlin Noise in 2D
Sample Function: Perlin Noise in 3D

Sample Function: Perlin Noise in 3D

Sample Function: Perlin Noise in 3D
Slicing

Slicing

Slicing
Streamlines

Streamlines

Streamlines
2D Streamlines

2D Streamlines

2D Streamlines
Subdivide Cells

Subdivide Cells

Subdivide Cells
Surface Smoothing

Surface Smoothing

Surface Smoothing
Surface Reconstruction

Surface Reconstruction

Surface Reconstruction
Using Common Filters

Using Common Filters

Using Common Filters
Voxelize a Surface Mesh

Voxelize a Surface Mesh

Voxelize a Surface Mesh
Warping by Vectors

Warping by Vectors

Warping by Vectors

Plotting#

These examples show case many of the possibilities for altering how you display spatial data. Explore these examples to learn how to leverage our powerful 3D plotting routines to perform tasks like:

  • Color mapping scalar values with matplotlib colormaps

  • Creating animations as GIFs or movie files

  • Showing the edges and nodes of different mesh types

  • Use sophisticated lighting techniques like smooth shading or Eye Dome Lighting

  • Glyph a vector or scalar field on a mesh (place/orient a mesh on another mesh’s nodes and scale/orient based on data values)

  • Label points in 3D space along side your meshes

  • Creating side-by-side comparisons

  • Making a dataset transparent or using a scalar value to map opacity

  • Adding textures/images draped over a mesh (texture mapping)

  • Rendering a depth image

Anti-Aliasing

Anti-Aliasing

Anti-Aliasing
Setting Backface Properties

Setting Backface Properties

Setting Backface Properties
Background Image

Background Image

Background Image
Blurring

Blurring

Blurring
Plotting Bounds

Plotting Bounds

Plotting Bounds
Chart Basics

Chart Basics

Chart Basics
Chart Overlays

Chart Overlays

Chart Overlays
Clearing a Mesh or the Entire Plot

Clearing a Mesh or the Entire Plot

Clearing a Mesh or the Entire Plot
Colormap Choices

Colormap Choices

Colormap Choices
Color Cycling

Color Cycling

Color Cycling
Composite Picking

Composite Picking

Composite Picking
Depth Peeling

Depth Peeling

Depth Peeling
Depth of Field Plotting

Depth of Field Plotting

Depth of Field Plotting
Label based on Distance on Line

Label based on Distance on Line

Label based on Distance on Line
Show Edges

Show Edges

Show Edges
Eye Dome Lighting

Eye Dome Lighting

Eye Dome Lighting
Plot with Floors

Plot with Floors

Plot with Floors
Hide Cells with Ghosting

Hide Cells with Ghosting

Hide Cells with Ghosting
Create a GIF Movie

Create a GIF Movie

Create a GIF Movie
Render a depth image

Render a depth image

Render a depth image
Interpolate Before Mapping

Interpolate Before Mapping

Interpolate Before Mapping
Moving Isovalue

Moving Isovalue

Moving Isovalue
Label Points

Label Points

Label Points
Lighting Properties

Lighting Properties

Lighting Properties
Linked Views in Subplots

Linked Views in Subplots

Linked Views in Subplots
Lookup Tables

Lookup Tables

Lookup Tables
Picking Meshes

Picking Meshes

Picking Meshes
Create a MP4 Movie

Create a MP4 Movie

Create a MP4 Movie
Save a Movie Using Glyphs

Save a Movie Using Glyphs

Save a Movie Using Glyphs
Create a GIF Movie of a Static Object with a Moving Colormap

Create a GIF Movie of a Static Object with a Moving Colormap

Create a GIF Movie of a Static Object with a Moving Colormap
Multi-Window Plot

Multi-Window Plot

Multi-Window Plot
Plot with Opacity

Plot with Opacity

Plot with Opacity
Orbiting

Orbiting

Orbiting
Orthogonal Slices

Orthogonal Slices

Orthogonal Slices
Physically Based Rendering

Physically Based Rendering

Physically Based Rendering
Plot Scalars Over a Circular Arc

Plot Scalars Over a Circular Arc

Plot Scalars Over a Circular Arc
Plot Over Line

Plot Over Line

Plot Over Line
Point Cell Scalars

Point Cell Scalars

Point Cell Scalars
Plotting Point Clouds

Plotting Point Clouds

Plotting Point Clouds
Picking points on a mesh

Picking points on a mesh

Picking points on a mesh
Customize Scalar Bars

Customize Scalar Bars

Customize Scalar Bars
Saving Screenshots

Saving Screenshots

Saving Screenshots
Types of Shading

Types of Shading

Types of Shading
Silhouette Highlight

Silhouette Highlight

Silhouette Highlight
Plot data in spherical coordinates

Plot data in spherical coordinates

Plot data in spherical coordinates
Surface Space Ambient Occlusion

Surface Space Ambient Occlusion

Surface Space Ambient Occlusion
Picking a Point on the Surface of a Mesh

Picking a Point on the Surface of a Mesh

Picking a Point on the Surface of a Mesh
Applying Textures

Applying Textures

Applying Textures
Control Global and Local Plotting Themes

Control Global and Local Plotting Themes

Control Global and Local Plotting Themes
Topographic Map

Topographic Map

Topographic Map
Plot Vector Component

Plot Vector Component

Plot Vector Component
Visible Vertices

Visible Vertices

Visible Vertices
Volume Rendering

Volume Rendering

Volume Rendering

Widgets#

PyVista has several widgets that can be added to the rendering scene to control filters like clipping, slicing, and thresholding - specifically there are widgets to control the positions of boxes, planes, and lines or slider bars which can all be highly customized through the use of custom callback functions.

Here we’ll take a look at the various widgets, some helper methods that leverage those widgets to do common tasks, and demonstrate how to leverage the widgets for user defined tasks and processing routines.

Box Widget

Box Widget

Box Widget
Checkbox Widget

Checkbox Widget

Checkbox Widget
Clip Volume Widget

Clip Volume Widget

Clip Volume Widget
Line Widget

Line Widget

Line Widget
Multiple Slider Widgets

Multiple Slider Widgets

Multiple Slider Widgets
Plane Widget

Plane Widget

Plane Widget
Slider Bar Widget

Slider Bar Widget

Slider Bar Widget
Sphere Widget

Sphere Widget

Sphere Widget
Spline Widget

Spline Widget

Spline Widget

Lighting#

These examples demonstrate how to take fine-tuned control over lighting conditions in a scene. Explore them to learn how to go beyond the default lighting setup to truly bring out the best of your visualization:

  • Choose between preset lighting systems for plotters

  • Disable lighting on the mesh level

  • Learn about the different light types

  • Customize the shape of positional lights

  • Use actors to visualize the beams of spotlights

Light Actors

Light Actors

Light Actors
Attenuation

Attenuation

Attenuation
Beam Shape

Beam Shape

Beam Shape
Light Types

Light Types

Light Types
Disabling Mesh Lighting

Disabling Mesh Lighting

Disabling Mesh Lighting
Plotter Lighting Systems

Plotter Lighting Systems

Plotter Lighting Systems
Shadows

Shadows

Shadows

Advanced#

Include here are few longer, more advanced examples from our users and developers.

Adding a New Gallery Example

Adding a New Gallery Example

Adding a New Gallery Example
Compare Field Across Mesh Regions

Compare Field Across Mesh Regions

Compare Field Across Mesh Regions
Plot Atomic Orbitals

Plot Atomic Orbitals

Plot Atomic Orbitals
Extending PyVista

Extending PyVista

Extending PyVista
Plot OpenFOAM data

Plot OpenFOAM data

Plot OpenFOAM data
Plot Open Street Map Data

Plot Open Street Map Data

Plot Open Street Map Data
3D Earth and Celestial Bodies

3D Earth and Celestial Bodies

3D Earth and Celestial Bodies
Plotting with VTK Algorithms

Plotting with VTK Algorithms

Plotting with VTK Algorithms
Visualize the Moeller–Trumbore Algorithm

Visualize the Moeller–Trumbore Algorithm

Visualize the Moeller–Trumbore Algorithm
Ray Tracing

Ray Tracing

Ray Tracing
Turning the sphere inside out

Turning the sphere inside out

Turning the sphere inside out
Displaying eigenmodes of vibration using ``warp_by_vector``

Displaying eigenmodes of vibration using warp_by_vector

Displaying eigenmodes of vibration using ``warp_by_vector``

Gallery generated by Sphinx-Gallery