A bit longer code, then sega_sai answer, but faster and for my experience much better for more complex surfaces.
Use plot_surface to build a flat surface where you want, and facecolors to color it with the values ββyou want
You may need to make your data smoother with scipy zoom.
from mpl_toolkits.mplot3d import axes3d import matplotlib.pyplot as plt,numpy as np plt.clf() fig = plt.figure(1) ax = fig.gca(projection='3d') X, Y, Z = axes3d.get_test_data(0.05) ax.plot_surface(X, Y, Z, rstride=8, cstride=8, alpha=0.3) cset = ax.contourf(X, Y, Z, zdir='x', offset=-40, cmap=plt.cm.jet) cset = ax.contourf(X, Y, Z, zdir='y', offset=40, cmap=plt.cm.jet)

It also makes it difficult to create a color bar so that:
cb = plt.cm.ScalarMappable(cmap=plt.cm.jet) cb.set_array(Z) plt.colorbar(cb) plt.show()
user4421975
source share