[ Web Proxy ]
URL:
Viewing: https://matplotlib.org/devdocs/api/_as_gen/../../project/../plot_types/3D/surface3d_simple.html [Back]  [Original]

plot_surface(X, Y, Z) — Matplotlib 3.12.0.dev737+g8881fa8c3 documentation
Back to top
Search the docs ...:

plot_surface(X, Y, Z)#

See plot_surface.

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

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

# Make data
X = np.arange(-5, 5, 0.25)
Y = np.arange(-5, 5, 0.25)
X, Y = np.meshgrid(X, Y)
R = np.sqrt(X**2 + Y**2)
Z = np.sin(R)

# Plot the surface
fig, ax = plt.subplots(subplot_kw={"projection": "3d"})
ax.plot_surface(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