import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
plt.ion()
fig = plt.figure()
axes = Axes3D(fig)
x = np.linspace(-np.pi,np.pi)
y = np.linspace(-np.pi,np.pi)
x, y = np.meshgrid(x, y)
z=np.cos(x)*np.sin(y)
axes.plot_surface(x, y, z, rstride=1, cstride=1, cmap=plt.cm.rainbow)
plt.show()