You can set the keyword arguments vmin
and vmax
in pyplot.pcolormesh
:
from numpy import linspace,meshgrid,pi,cos,sin
from matplotlib.pyplot import figure, show
x=linspace(0,100);y=linspace(0,100)
X,Y=meshgrid(x,y)
Z=cos(3*pi*X)+sin(6*pi*Y)
fig=figure()
ax=fig.add_subplot(111)
pc=ax.pcolormesh(X,Y,Z,vmin=0.3,vmax=0.6)
fig.colorbar(pc)
show()
This will make the values outside of your range saturate, so they'll all show up as the same colour. Happy matplotlibbing.