from mpl_toolkits.mplot3d import Axes3D figure() imshow(sphere[:,:,GRID_SIZE>>1], interpolation='none', cmap=cm.gray) title('2d slice from input sphere') # Plot large magnitude wavelet coefficients' position in 3D. figure(figsize=(16,9)) Yh = sphere_t.highpasses nplts = Yh[-1].shape[3] nrows = np.ceil(np.sqrt(nplts)) ncols = np.ceil(nplts / nrows) W = np.max(Yh[-1].shape[:3]) for idx in range(Yh[-1].shape[3]): C = np.abs(Yh[-1][:,:,:,idx]) ax = gcf().add_subplot(nrows, ncols, idx+1, projection='3d') ax.set_aspect('equal') good = C > 0.2*C.max() x,y,z = np.nonzero(good) ax.scatter(x, y, z, c=C[good].ravel()) ax.auto_scale_xyz((0,W), (0,W), (0,W)) tight_layout()