cb=fig.colorbar(mpl.cm.ScalarMappable(norm=norm, cmap=cmap),
extend='neither',
orientation='vertical',shrink=0.9,
fraction=0.046, pad=0.04
)
# cax=position, orientation='horizontal',shrink=1
cb.set_label('groundwater level (m)',fontweight='bold',fontsize=50)
from matplotlib.ticker import FormatStrFormatter
cb.ax.yaxis.set_major_formatter(FormatStrFormatter('%.2f'))
python改变colorbar tick format
最新推荐文章于 2023-09-14 17:06:07 发布