So, I have a 2D array (named Data) that looks like this:
Shape 0 Shape 1 ... Shape N ------- ------- ------- Scale 0 | Value00 , Value01 ... Value0N | Scale 1 | Value10 , Value11 ... Value1N | . . . Scale N | ValueN0 , ValueN1 ... ValueNN |
And I want to create a 3D plot where ValueXX is the Z axis. I tried two attempts, but each one gives me a surface that rotates with respect to the other, so I'm a little confused. Here is my first attempt at a solution:
x,y = numpy.mgrid[0:50:50j,0:50:50j] f = Data fig = plt.figure() ax = Axes3D(fig) ax.plot_surface(x,y,f,rstride=1,cstride=1)
Here is my second attempt:
nx, ny = 50, 50 x = range(nx) y = range(ny) hf = plt.figure() ha = hf.add_subplot(111, projection='3d') X, Y = numpy.meshgrid(x, y) ha.plot_surface(X,Y,Data,rstride=1,cstride=1)
Examining X and Y does not really help, because its square. I am not sure when X represents my "Scale", when it represents my "form".
So what is happening with these two examples? Is there a better way to build this array?
Thanks!