【发布时间】:2019-10-03 12:37:41
【问题描述】:
【问题讨论】:
标签: python matplotlib
【问题讨论】:
标签: python matplotlib
你想要Axes.ticklabel_format()。试试这个,例如:
import numpy as np
import matplotlib.pyplot as plt
x = np.arange(100)
y = np.random.random(100) * 1e5
fig, ax = plt.subplots()
ax.plot(x, y)
ax.ticklabel_format(axis='y', scilimits=[-3, 3])
plt.show()
这会导致:
来自文档:
sclimits — (m, n),整数对;如果 style 是 'sci',科学记数法将用于 10m 到 10n 范围之外的数字。使用 (0,0) 包括所有数字。使用 (m,m) where m 0 将数量级固定为 10m。
【讨论】: