2016-05-24 50 views
2

http://matplotlib.org/api/ticker_api.html 上說查詢matplotlib股票模塊

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' 

回答

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()