Python-anaconda-Spyder使用matplotlib画图无法显示报错解决:Figures now render in the Plots pane by default. To make them also appear inline in the Console, uncheck "Mute Inline Plotting" under the Plots pane options menu.

此文首发于我的Jekyll博客:zhang0peter的个人博客


晚上在用anaconda的Spyder IDE,用 matplotlib 画图时不会显示图片在iPython终端中,报错如下:

Figures now render in the Plots pane by default. To make them also appear inline in the Console, uncheck "Mute Inline Plotting" under the Plots pane options menu. 

网上查找资料后发现问题所在:python - Spyder Plot Inline - Stack Overflow

说的是最新版本的Spyder 4.0默认显示图片在右上角,不显示在终端中,如图所示:

图片

想要弹出窗口显示matplotlib画的图片,修改设置:

Tools > Preferences > iPython console > Graphics > Graphics backend > Automatic

重启IDE,现在画图就会弹出窗口显示了。