with the help of this post,
matplotlib standard colormap usage
I kind of figure out.
there are two parts in the whole process. one is contourf, one is colormap.
for colormap, define colors and normalize them. This part decides what color should be used at which time, if this colormap is chosen to plot.
for contourf, level deals with which part you want to plot. It seems, vmin and vmax is of little use in this part. Or maybe I haven't find some.
for example,
first defines a cmap
import matplotlib.pyplot as plt
from matplotlib import colors
cmap1 = plt.cm.jet
cmap = colors.ListedColormap(['r','b','g'])
bounds = [0,1,2,3]
norm = colors.BoundaryNorm(bounds, cmap.N)
a = plt.contourf([[1, 1], [3, 3],[5,5]], cmap = cmap, \
norm = norm, levels = [0,1,2])
plt.colorbar()
plt.show()
this means between [0,1], the color will be red, and between [1,2], will be blue, and so on.
Then, if you define a level in contourf, e.g. [0,1,2] first, the program will categorize your data into different parts according to your level. In this the program only cares about [0,1,2], because you leveled it before.
And between [0,1],the mid point is 0.5, refering to the cmap, it should be red, but look at the data, there is no data between [0,1], so go on.
when it comes to [1,2], the mid point should be 1.5, it should be blue, according to the cmap. and data exist in this range, so the data is plotted.
Here, it is the end of the level. the program stops, although you have data over 2.

And if I change the level to [0,1,2,3,4,5,6,7], the result is as below. So when the level exceeds the cmap, the exceeding part will show the same color. In this case, when the value exceeds 3, there is no color defined in the colormap dealing with value over 3, so it stays the same color as in range [2,3].

And now change bounds to [1,2,3,4] and level to [0.6,1.5,2.5,3.5], the result is following,

So, first interval, [0.6,1.5], the mid point is 1.05, according to cmap, it should be red. And the rest parts follow the same rule.