On Tuesday, August 30, 2011, Katie Boyle <firstname.lastname@example.org> wrote:
> Hi All,
> I have a 2D grid comprised of 100 nodes in X, 300 nodes in Z, and a single node in Y. I have a scalar value defined at each node point.
> I want to display this planar grid in 3D by first rendering a contour plot (no problems there) and then rotating it such that it plots as a vertical sheet when viewed in 3D. Right now it is automatically forced to reside in the X-Y plane, but I want it to reside in the X-Z plane. Here is an excerpt from my code:
> fig = plt.figure(figsize=(25,20))
> ax = Axes3D(fig)
> ax.contourf(xx, yy, zz, 100, cmp = plt.cm.jet,zdir='y',extend3D=False)
> ax.bar3d(5000, 625, 1500, 1, 1, 1, color='r')
> ax.set_xlabel("X [m]")
> ax.set_ylabel("Y [m]")
> ax.set_zlabel("Z [m]")
> I think the 'zdir' flag is supposed to do this exact task, but setting it to 'y' seems to have no effect on my plot. Also, the plot is being extended into 3D even though I set the extend3D flag to False. Can anyone tell me what I'm doing wrong?
What version of mpl are you using? I don't think those kwargs were added until the upcoming release, v1.1.0. Does the graph look right if you do just contour?
Plus, from the top of my head, I don't think extend3d works for contourf (but I could be wrong).