ax3 = fig.add_axes(config['setpng']['colorbar']) # 四个参数分别是左、下、宽、长 cb3 = mpl.colorbar.ColorbarBase(ax3, cmap=_cmap,norm=norm) # set_colorbar_ticks(cb3,levels,config['levels']['wind_s_label']) #色标刻度调整 cb3.set_ticks(levels) aa=np.array(levels) bb=np.append(aa[1:],np.array([100]),axis=0) new_levels=(aa+bb)/2 # ax4=ax3 cb4 = mpl.colorbar.ColorbarBase(ax3, cmap=_cmap,norm=norm,ticks=None) cb4.set_ticks(new_levels) cb4.set_ticklabels(config['levels']['wind_s_label']) ax3.tick_params(axis="both", which="both", length=0, labelsize=10)
标签:ax3,set,Python,标签,ticks,colorbar,levels,刻度 From: https://www.cnblogs.com/xiaoxiaoshuaishuai0219/p/17474871.html