Runtimeerror: cannot get window extent w/o renderer with seaborn

冷暖自知 提交于 2019-12-22 08:25:12

问题


So I'm trying to get some stuff running with seaborn (specifically this example)

However when I run on normal ipython I get the runtime error listed in the title. It seems like a backend issue but I don't experience this with any other plotting utilities. Even stranger, if I run in the ipython notebook I no longer experience that error. I can certainly work with in the notebook for now and avoid problems but it's concerning that this happens in a terminal.


回答1:


This seems to be an issue with the MacOSX backend. It is tracked at matplotlib's issue tracker, but a fix apparently needs major rewriting and is not finished yet. (I guess related to this issue).

In the meantime switching the plotting backend is a workaround.

This can be done e.g. via command line by starting ipython with

ipython --matplotlib <your-favorite-backend>

Choosing an invalid backend (ipython --matplotlib ??) will print all available backends.

[TerminalIPythonApp] CRITICAL | Bad config encountered during initialization:
[TerminalIPythonApp] CRITICAL | The 'matplotlib' trait of a TerminalIPythonApp instance must be any of ['auto', 'gtk', 'gtk3', 'inline', 'nbagg', 'osx', 'qt', 'qt4', 'qt5', 'tk', 'wx'] or None, but a value of '??' <class 'str'> was specified.


来源:https://stackoverflow.com/questions/27868865/runtimeerror-cannot-get-window-extent-w-o-renderer-with-seaborn

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!