I am trying to do a plot with the extend='max' option of contourf. However the the colorbar is forced to the right-side bottom of the plot with this oprion. The colorbar is centered (as it should be) when the extend option is not used. Plot with extend='max' option: Plot with no extend option: Relevant code snippet: contour = ax.contourf(x, y, val, cmap='gist_yarg', extend='max', levels=np.linspace(0, 0.1, 200)) cbar = plt.colorbar(contour, fraction=0.05, pad=0.03, format='%.2f') How can I ensure that the colorbar remains centered ? Thanks. Continue reading...