How to change the the number of digits of the mantissa using offset notation in matplotlib colorbar
问题 I have a contour plot in matplotlib using a colorbar which is created by from mpl_toolkits.axes_grid1 import make_axes_locatable divider = make_axes_locatable(axe) #adjust colorbar to fig height cax = divider.append_axes("right", size=size, pad=pad) cbar = f.colorbar(cf,cax=cax) cbar.ax.yaxis.set_offset_position('left') cbar.ax.tick_params(labelsize=17)#28 t = cbar.ax.yaxis.get_offset_text() t.set_size(15) How can I change the colorbar ticklabels (mantissa of exponent) showing up with only 2