我有一张图片:

在y轴上我想得到的5x10^-5 4x10^-5等等而不是0.00005 0.00004.
到目前为止我尝试过的是:
fig = plt.figure()
ax = fig.add_subplot(111)
y_formatter = matplotlib.ticker.ScalarFormatter(useOffset=True)
ax.yaxis.set_major_formatter(y_formatter)
ax.plot(m_plot,densities1,'-ro',label='0.0<z<0.5')
ax.plot(m_plot,densities2, '-bo',label='0.5<z<1.0')
ax.legend(loc='best',scatterpoints=1)
plt.legend()
plt.show()
Run Code Online (Sandbox Code Playgroud)
这似乎不起作用.代码的文档页面似乎没有提供直接的答案.