plot([1000, 1001, 1002], [1, 2, 3])gca().get_xaxis().get_major_formatter().set_useOffset(False)draw()
这将抓取
current axes,获取x轴axis对象,然后获取主
formatter对象,并将
useOffset设置为false(doc)。
在matplotlib的较新版本(1.4+)中,可以通过
axes.formatter.useoffsetrcparam更改默认行为。

plot([1000, 1001, 1002], [1, 2, 3])gca().get_xaxis().get_major_formatter().set_useOffset(False)draw()
这将抓取
current axes,获取x轴axis对象,然后获取主
formatter对象,并将
useOffset设置为false(doc)。
在matplotlib的较新版本(1.4+)中,可以通过
axes.formatter.useoffsetrcparam更改默认行为。