Note

Go to the endto download the full example code.

Plot contour (level) curves in 3D#

This is like a contour plot in 2D except that thef(x,y)=c curve isplotted on the planez=c.

importmatplotlib.pyplotaspltfrommpl_toolkits.mplot3dimportaxes3dax=plt.figure().add_subplot(projection='3d')X,Y,Z=axes3d.get_test_data(0.05)ax.contour(X,Y,Z,cmap="coolwarm")# Plot contour curvesplt.show()
contour3d

Tags:plot-type: 3Dlevel: beginner

Gallery generated by Sphinx-Gallery