Skip to main content

mpl3d-vtk

简体中文

mpl3d-vtk adds a VTK-backed vtk3d projection to Matplotlib. Draw NumPy data as surfaces, triangle meshes, scalar volumes, or vector fields. Use Matplotlib for axes, camera controls, colorbars, layout, and figure export.

Installation

python -m pip install mpl3d-vtk

To install from a source checkout, run python -m pip install . from its root.

Requires Python 3.11+, NumPy 1.25+, Matplotlib 3.11.x, VTK 9.4–9.x, and a working OpenGL context. For headless rendering, see the export guide.

Quickstart

Import mpl3d_vtk to register the vtk3d projection. Call mpl3d_vtk.plot_rc() before creating a figure to apply the my-mpl-style preset with custom legends and 3D axes.

import matplotlib.pyplot as plt
import numpy as np
import mpl3d_vtk

mpl3d_vtk.plot_rc()
t = np.linspace(-2, 2, 201)
x, y = np.meshgrid(t, t)
z = np.exp(x * np.sin(y))

fig = plt.figure(figsize=(9, 4), layout="constrained")
ax = fig.add_subplot(121, projection="vtk3d")
surface = ax.plot_surface(x, y, z, cmap=plt.get_cmap())
mpl3d_vtk.ax_setting(ax)
ax.set(xlabel="x", ylabel="y", zlabel="u")
fig.colorbar(surface, ax=ax, shrink=.7)

profile = fig.add_subplot(122)
profile.plot(t, np.exp(t))
profile.set(xlabel="x", ylabel="u", title=r"$y=\pi/2$")

fig.savefig("surface.png", dpi=180)
plt.show()

Use ax.view_init() to change the view and surface.set_heights() or surface.set_values() to update data. Multiple plots on the same axes share the VTK depth buffer.

ax_setting applies equal data scaling, an orthographic view, and projected ticks. Omitted limits and tick locations use the current axes settings.

Examples

Intersecting scalar slices Random-field zero isosurface
Three intersecting scalar slices with a shared colorbar Green zero isosurface of a seeded random field
Source code Source code

Documentation

Metadata

Release files for mpl3d-vtk 0.5.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mpl3d-vtk 0.5.8
File Size Uploaded Provenance Actions
mpl3d_vtk-0.5.8.tar.gz 15.3 MB With provenance Details for mpl3d_vtk-0.5.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mpl3d-vtk 0.5.8
File Interpreter ABI Platform Actions
mpl3d_vtk-0.5.8-py3-none-any.whl Python 3 none any Details for mpl3d_vtk-0.5.8-py3-none-any.whl

Total release size: 15.3 MB

Release files / mpl3d_vtk-0.5.8.tar.gz

Download URL mpl3d_vtk-0.5.8.tar.gz
Size 15.3 MB
Tags Source
SHA-256 checksum
How to use checksums
9178d2854a226c737a8b7f3a05ff9f8bc2698f0196abdd5d716e76eb9ddd5e06
BLAKE2b-256 checksum
How to use checksums
cf39f80c31a42f3c828c2e8b6a6269a15ce8d954fda43fe7716de0b63747705b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / mpl3d_vtk-0.5.8-py3-none-any.whl

Download URL mpl3d_vtk-0.5.8-py3-none-any.whl
Size 35.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
608f1dc65d1d95a137806130532d3f164dcd6d6c17e1d6b6be61eb1035c4467f
BLAKE2b-256 checksum
How to use checksums
7217c4437d2aeb7ef6ea6fa1a034dbc99cc6f6321f870de1bdcff83358f752bd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Security for mpl3d-vtk 0.5.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for mpl3d_vtk-0.5.8.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page