显示次刻度 set_minor_locator() Python用plt画图时,有时不显示次刻度,解决办法: ax = plt.gca() yminorLocator = AutoMinorLocator() ax.yaxis.set_minor_locator(yminorLocator)