Skip to main content

mpl-depth-style

简体中文

mpl-depth-style adds a VTK-backed vtk3d projection to Matplotlib. Draw NumPy data as gridded surfaces, triangle meshes, isosurfaces, lines, and scatter plots. Use Matplotlib for axes, camera controls, colorbars, layout, and figure export.

Installation

From the root of a source checkout, run python -m pip install ..

To install a published release from PyPI, run python -m pip install mpl-depth-style.

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 mpl_depth_style to register the vtk3d projection. Call mpl_depth_style.plot_rc() before creating a figure to set typography, 2D styling, and a seven-color series cycle. See the style preview.

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

mpl_depth_style.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())
mpl_depth_style.ax3D_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.

ax3D_setting applies equal data scaling, an orthographic view, and projected ticks with regular-weight labels. Omitted limits and tick locations use the current axes settings. Pass grid=False to hide the 3D grid on that subplot.

Examples

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

Documentation

Metadata

Release files for mpl-depth-style 0.6.1

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

Source distribution (sdist)

Source distribution for mpl-depth-style 0.6.1
File Size Uploaded Provenance Actions
mpl_depth_style-0.6.1.tar.gz 8.8 MB With provenance Details for mpl_depth_style-0.6.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mpl-depth-style 0.6.1
File Interpreter ABI Platform Actions
mpl_depth_style-0.6.1-py3-none-any.whl Python 3 none any Details for mpl_depth_style-0.6.1-py3-none-any.whl

Total release size: 8.8 MB

Release files / mpl_depth_style-0.6.1.tar.gz

Download URL mpl_depth_style-0.6.1.tar.gz
Size 8.8 MB
Tags Source
SHA-256 checksum
How to use checksums
49d457169a05c69d93f4ffd1914dd89d057f2b7122e1620bc55ebe23b36b8897
BLAKE2b-256 checksum
How to use checksums
b94d4b46d8a847df6f85dbe4e5356a41d5a6e607a34ab73fecb0e42f24824045
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 28, 2026.

Transparency log

Release files / mpl_depth_style-0.6.1-py3-none-any.whl

Download URL mpl_depth_style-0.6.1-py3-none-any.whl
Size 23.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d526fe868cedeb0b6871361d0ce93cf86571cd5c653dd780abb72ad8ba688b41
BLAKE2b-256 checksum
How to use checksums
d975ecd9b9f84015887c66aee84811ab71b99b71956fe1e03be1dd7fc1f69166
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 28, 2026.

Transparency log

Security for mpl-depth-style 0.6.1

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 mpl_depth_style-0.6.1.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 28, 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.

Release history Release notifications | RSS feed

This release

0.6.1 This release

2 release files Full provenance

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