I have a (2640, 96, 17)
array. I am able to plot it by scatter plot but I would like to see the whole shape of this array, so I think the surface plot or contour will be better. But I cannot deal with z must be 2D array
. z.ndim
shows 2. I don't know what is going on. Or anyone could provide a new method for me, I will be highly appreciated.
x = np.arange(Outfinal_add.shape[0])[:, None, None]
y = np.arange(Outfinal_add.shape[1])[None, 30:60, None]
x, y= np.broadcast_arrays(x, y)
Z = np.zeros((Outfinal_add.shape[1],Outfinal_add.shape[2]))
Z = Outfinal_add[1][:]
fig = plt.figure()
ax = fig.gca(projection='3d')
ax.contourf(x.ravel(),
y.ravel(),
Z.ravel())
Outfinal_add
is the original data array (2640,96,17)
.