我试图让 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'

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

任何想法可能会出错?

最佳答案

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

关于python - matplotlib xkcd 不工作,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/19727543/

10-12 18:16