【发布时间】:2016-02-03 13:40:39
【问题描述】:
我想将我的刻度格式化为一定数量的有效数字,并删除自动偏移量。对于后者,我使用https://stackoverflow.com/a/6654046/1021819,对于前者,我将使用https://stackoverflow.com/a/25750438/1021819,即
y_formatter = matplotlib.ticker.ScalarFormatter(useOffset=False)
ax.yaxis.set_major_formatter(y_formatter)
和
ax.yaxis.set_major_formatter(mtick.FormatStrFormatter('%.2e'))
如何结合使用 FormatStrFormatter 和 useOffset 语法?
【问题讨论】:
标签: python matplotlib