fig = plt.figure(figsize=(15, 8))
ax = plt.axes(projection='3d')
bar5 = ax.scatter3D(xs=result[:, 0], ys=result[:, 1], zs=out2.reshape(-1), c= out2.reshape(-1), cmap=cm.coolwarm);
ax.set_xlabel('x')
ax.set_ylabel('y')
ax.set_zlabel('z');
# we use view_init in changing the viewing angle
ax.view_init(50, 150)
plt.colorbar(bar)