您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

在Jupyter Ipython中更改Matplotlib的默认后端

在Jupyter Ipython中更改Matplotlib的默认后端

这个问题类似于IPython Notebook中的内联自动运行%matplotlib内联,除了您要自动使用TK后端而不是内联后端。

因此,想法是找到您的IPython配置文件。请参阅配置IPython。它应该是

/.ipython/profile_default/ipython_kernel_config.py

如果尚不存在,请通过创建> ipython profile create

在此文件中找到设置c.InteractiveShellApp.matplotlib并将其设置为"tk"。然后应该看起来像

## Configure matplotlib for interactive use with the default matplotlib backend.
c.InteractiveShellApp.matplotlib = "tk"

保存文件并重新启动内核。

python 2022/1/1 18:28:56 有192人围观

撰写回答


你尚未登录,登录后可以

和开发者交流问题的细节

关注并接收问题和回答的更新提醒

参与内容的编辑和改进,让解决方法与时俱进

请先登录

推荐问题


联系我
置顶