I am currently generating different figures with a scientific notation for the y-axis leading to ticks like 2 or 6 on some plots, but 2.5 or 8.9 on some others. I would like to
You can get the ticks and format it like you want.
plt.plot(np.arange(1, 10), np.arange(1, 10)**5) ax = plt.gca() plt.ticklabel_format(axis='y', style='sci') ax.yaxis.major.formatter.set_powerlimits((0,0)) xx, locs = plt.xticks() ll = ['%.1f' % a for a in xx] plt.xticks(xx, ll) plt.show()