So I have a 2D array (named Data) that looks like:
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 the ValueXXs are the Z axis. I've tried two attempts, but each give me a surface that is rotated with respect to the other one, so I've gotten myself a bit confused. Here is my 1st 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 no help really because its a square. I'm not sure when X represents my 'Scale' vs when it is representing my 'Shape'.
So, what is really going on with these two examples? Is there a better way to plot this array?
Thanks!