When I use contourf, matplotlib chooses to group the values into similar regions and color those regions. How can I make this plot show the full spectrum of different values? In the code below, I want the colors to be continuous, so that sun over the hill is a gradient of increasing colors, instead of these sudden changes in color.
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
import numpy as np
delta = 0.025
x = np.arange(-3.0, 3.0, delta)
y = np.arange(-2.0, 2.0, delta)
X, Y = np.meshgrid(x, y)
Z1 = mlab.bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0)
Z2 = mlab.bivariate_normal(X, Y, 1.5, 0.5, 1, 1)
Z = 10.0 * (Z2 - Z1)
CS = plt.contourf(X, Y, Z, vmin = 0., vmax = 3., cmap=plt.cm.coolwarm)
plt.show()
