i trying create 2d plots of projection of 3d data. simply, based on this example there way produce 3 contour projections shown (in x, y, , z directions) separate 2d plots? can create contour projection in z direction using pyplot 'contour' command, '3d' projection 'contour' command seems able take 'zdir' parameter, , can't create 2d plots.
the zdir
parameter in 3d contour says axis used determine contour levels in 3d plot. in 2d plot specified order of arguments, think of "z", is, values determine contour level, put in third argument. in example below, note in particular first 3 arguments in each of contourf calls:
from mpl_toolkits.mplot3d import axes3d import matplotlib.pyplot plt matplotlib import cm x, y, z = axes3d.get_test_data(0.05) plt.subplot(131) cset = plt.contourf(x, y, z, cmap=cm.coolwarm) plt.subplot(132) cset = plt.contourf(y, z, x, cmap=cm.coolwarm) plt.subplot(133) cset = plt.contourf(x, z, y, cmap=cm.coolwarm) plt.show()
compared projections in 3d plot:
note here i've referred "the third argument", there lots of ways arguments contourf can interpreted, see docs more details, although approach work calls x, y, , z explicit.