没有科学的y轴matplotlib

时间:2019-08-25 01:33:15

标签: matplotlib

我正在用此代码获得科学记数法y轴标签。我只想要纯数字。我该怎么办?

import matplotlib.pyplot as plt
import matplotlib

from IPython.core.display import display, HTML
#display(HTML("<style>.container { width:70% !important; }</style>"))
display(HTML("<style>.container { width:100% !important; }</style>"))
%matplotlib inline

from matplotlib.ticker import ScalarFormatter, FormatStrFormatter

plt.rcParams['figure.figsize'] = [20, 10]
fig, ax = plt.subplots()

ax.semilogy(df.close)
ax.grid()
ax.yaxis.set_major_formatter(FormatStrFormatter('%.0f'))

plt.show()

0 个答案:

没有答案