gpt4 book ai didi

python - matplotlib.pyplot 没有属性 'style'

转载 作者:IT老高 更新时间:2023-10-28 22:21:30 28 4
gpt4 key购买 nike

我正在尝试按照教程 http://matplotlib.org/users/style_sheets.html 在 matplotlib 中设置样式

import matplotlib.pyplot as plt
plt.style.use('ggplot')

但我得到的返回是:

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

我的 matplotlib 版本是 1.1.1(我在运行 Mavericks 的 Mac 上)。这个版本的样式在哪里?

谢谢!

最佳答案

My matplotlib version is 1.1.1

你的问题。 The style package was added in version 1.4 .你应该更新你的版本。

关于python - matplotlib.pyplot 没有属性 'style',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27204646/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com