查询matplotlib自动收报机模块

时间:2016-05-24 03:19:36

标签: python-2.7 matplotlib

http://matplotlib.org/api/ticker_api.html

  

ax.get_xaxis()。get_major_formatter()。set_useOffset(假)

什么是斧头?如果它是我从

中理解的pyplot对象
  

ax.plot(np.arange(2000,2010),范围(10))

比起为什么我说:

    In [107]: ax.get_xaxis
    ---------------------------------------------------------------------------
    AttributeError                            Traceback (most recent call last)
    <ipython-input-107-7bca17863338> in <module>()
    ----> 1 ax.get_xaxis

    AttributeError: 'module' object has no attribute 'get_xaxis'

1 个答案:

答案 0 :(得分:0)

以下是应该写在那里的完整代码:

import matplotlib.pyplot as plt
import numpy as np
fig, ax = plt.subplots(1)
ax.plot(np.arange(2000, 2010), range(10))
ax.get_xaxis().get_major_formatter().set_useOffset(False)
plt.show()