[ Web Proxy ]
URL:
Viewing: https://matplotlib.org/stable/api/_as_gen/../../devel/MEP/../../plot_types/3D/trisurf3d_simple.html [Back]  [Original]

plot_trisurf(x, y, z) — Matplotlib 3.11.2 documentation
Back to top
Search the docs ...:

plot_trisurf(x, y, z)#

See plot_trisurf.

trisurf3d simple [trisurf3d simple]
import matplotlib.pyplot as plt
import numpy as np

plt.style.use('_mpl-gallery')

n_radii = 8
n_angles = 36

# Make radii and angles spaces
radii = np.linspace(0.125, 1.0, n_radii)
angles = np.linspace(0, 2*np.pi, n_angles, endpoint=False)[..., np.newaxis]

# Convert polar (radii, angles) coords to cartesian (x, y) coords.
x = np.append(0, (radii*np.cos(angles)).flatten())
y = np.append(0, (radii*np.sin(angles)).flatten())
z = np.sin(-x*y)

# Plot
fig, ax = plt.subplots(subplot_kw={'projection': '3d'})
ax.plot_trisurf(x, y, z, vmin=z.min() * 2, cmap="Blues")

ax.set(xticklabels=[],
       yticklabels=[],
       zticklabels=[])

plt.show()

Gallery generated by Sphinx-Gallery


Web Proxy Viewer  |  New URL  |  Original Page