[ Web Proxy ]
URL:
Viewing: https://matplotlib.org/stable/api/_as_gen/../../gallery/misc/../animation/../mplot3d/contour3d.html [Back]  [Original]

Plot contour (level) curves in 3D — Matplotlib 3.11.2 documentation
Back to top
Search the docs ...:

Plot contour (level) curves in 3D#

This is like a contour plot in 2D except that the f(x, y)=c curve is plotted on the plane z=c.

import matplotlib.pyplot as plt

from mpl_toolkits.mplot3d import axes3d

ax = plt.figure().add_subplot(projection='3d')
X, Y, Z = axes3d.get_test_data(0.05)

ax.contour(X, Y, Z, cmap="coolwarm")  # Plot contour curves

plt.show()
contour3d [contour3d]

Tags: plot-type: 3D level: beginner

Gallery generated by Sphinx-Gallery


Web Proxy Viewer  |  New URL  |  Original Page