matplotlib adding colorbar changes fig size code example Example: change colorbar size and place python plt.colorbar(im,fraction=0.046, pad=0.04)