matplotlib xkcd无法正常工作

lkr*_*ner 4 python matplotlib

我试图让matplotlib xkcd函数正常工作,在安装完所有必要的东西之后.http://matplotlib.org/xkcd/examples/showcase/xkcd.html

每次我得到这个:

Traceback (most recent call last):
  File "graph.py", line 4, in <module>
    plt.xkcd()
AttributeError: 'module' object has no attribute 'xkcd'
Run Code Online (Sandbox Code Playgroud)

(我将代码保存为graph.py)

什么想法可能会出错?

And*_*ndy 5

xkcd模块已添加到matplotlib 1.3.1中.您需要将版本更新为该版本才能使xkcd示例正常工作.