def func3(x, y):
    return (1 - x / 2 + x ** 5 + y ** 3) * exp(-x ** 2 - y ** 2)
dx, dy = 0.05, 0.05
x = arange(-3.0, 3.0, dx)
y = arange(-3.0, 3.0, dy)
X, Y = meshgrid(x, y)
xmin, xmax, ymin, ymax = amin(x), amax(x), amin(y), amax(y)
extent = xmin, xmax, ymin, ymax
fig = plt.figure(frameon=False)
Z2 = func3(X, Y)
im2 = imshow(Z2, cmap=cm.jet, alpha=0.9, interpolation='bilinear', extent=
    extent)
show()
matplotlib color gradient in patches?