set colorbar range matplotlib code example Example: matplotlib set colorbar range plt.pcolor(X, Y, f(data), cmap=cm, vmin=-4, vmax=4)