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