【问题标题】:matplotlib layout like plotly by handmatplotlib 布局,如手工绘制
【发布时间】:2015-01-16 05:46:19
【问题描述】:

我正在使用 matplotlib 进行绘图,并试图获得像 plotly 这样的漂亮布局。特别是我想要一个条形图/箱形图,填充和轮廓颜色相同。不是默认的黑色/灰色轮廓和彩色轮廓,而是像plotly。有没有样式表的建议?

解决了以下问题:

因为通过搜索解决方案我找到了样式表,但是我在尝试按照官方manual在python matplotlib中加载特定样式表时收到以下错误消息:

>>> import matplotlib.pyplot as plt
>>> plt.style.use('ggplot')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'style'

同样的问题:

>>> print plt.style.available
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'style'

系统信息:

>>> matplotlib.__version__
'1.3.1'

看来我的安装有问题,但我该怎么办?有什么建议吗?

【问题讨论】:

    标签: python matplotlib plot stylesheet


    【解决方案1】:

    the release notes 所示,style 包被添加到 matplotlib 1.4 中。如果你想使用它,你需要升级。

    【讨论】:

    • 感谢您的建议,所以我将等待包含 1.4 版的预构建包。
    • @bijah:你在哪个平台上? the matplotlib site上有二进制下载。
    • @BranBarn:我在 ubuntu 14.4 上。我开始阅读安装站点,但没有真正的洞察力,所以我想我会等待......
    猜你喜欢
    • 1970-01-01
    • 2016-10-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-06-10
    • 2022-01-10
    • 2020-07-10
    • 2011-07-09
    相关资源
    最近更新 更多