首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >熊猫绘制导致iPython错误的选项

熊猫绘制导致iPython错误的选项
EN

Stack Overflow用户
提问于 2014-10-02 01:38:10
回答 1查看 210关注 0票数 0

我正在尝试一些这里上显示的熊猫图样。但是,每当我按照建议使用以下命令设置样式选项时,

代码语言:javascript
复制
pd.options.display.mpl_style = 'default'

我得到以下错误

代码语言:javascript
复制
In [6]: Traceback (most recent call last):
  File "/Users/seanwhipple/py27/lib/python2.7/site-packages/matplotlib/artist.py", line 59, in draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "/Users/seanwhipple/py27/lib/python2.7/site-packages/matplotlib/figure.py", line 1079, in draw
    func(*args)
  File "/Users/seanwhipple/py27/lib/python2.7/site-packages/matplotlib/artist.py", line 59, in draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "/Users/seanwhipple/py27/lib/python2.7/site-packages/matplotlib/axes/_base.py", line 2092, in draw
    a.draw(renderer)
  File "/Users/seanwhipple/py27/lib/python2.7/site-packages/matplotlib/artist.py", line 59, in draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "/Users/seanwhipple/py27/lib/python2.7/site-packages/matplotlib/axis.py", line 1105, in draw
    renderer)
  File "/Users/seanwhipple/py27/lib/python2.7/site-packages/matplotlib/axis.py", line 1054, in _get_tick_bboxes
    extent = tick.label1.get_window_extent(renderer)
  File "/Users/seanwhipple/py27/lib/python2.7/site-packages/matplotlib/text.py", line 741, in get_window_extent
    bbox, info, descent = self._get_layout(self._renderer)
  File "/Users/seanwhipple/py27/lib/python2.7/site-packages/matplotlib/text.py", line 311, in _get_layout
    ismath=False)
  File "/Users/seanwhipple/py27/lib/python2.7/site-packages/matplotlib/backends/backend_macosx.py", line 166, in get_text_width_height_descent
    six.text_type(s), family, size, weight, style)
TypeError: bad argument type for built-in operation

If you suspect this is an IPython bug, please report it at:
    https://github.com/ipython/ipython/issues
or send an email to the mailing list at ipython-dev@scipy.org

You can print a more detailed traceback right now with "%tb", or use "%debug"
to interactively debug it.

Extra-detailed tracebacks for bug-reporting purposes can be enabled via:
    %config Application.verbose_crash=True

在编写测试代码时,我发现当我添加pd.options行时,会生成错误。有什么原因吗?我已经将numpypandasmatplotlib更新为使用pip --upgrade的最新版本。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-10-02 02:27:06

这是与https://github.com/matplotlib/matplotlib/issues/3470相同的问题--问题是,由于rcparams验证中的一个微妙的疏忽,macOSX后端期望的是一个由字节字符串对象组成的列表,因此事情就发生了变化。

最简单的方法是使用macosx后端以外的任何其他后端。正在进行中的修补程序(https://github.com/matplotlib/matplotlib/pull/3564),但它已经变成了一个泥潭的其他微妙的错误。

仍在试图决定这是否需要在1.4.1上成为一个阻滞剂。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/26153254

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档