如何在Spyder / IPython / matplotlib中再次获得交互式图? [英] How do I get interactive plots again in Spyder/IPython/matplotlib?

查看:693
本文介绍了如何在Spyder / IPython / matplotlib中再次获得交互式图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows 7中从Python(x,y)2.7.2.3升级到:





所以我进入选项并发现了这个:





这似乎说我可以将旧的交互式图表重新打开,其中4个子图显示为侧面而且,当我切换到自动,并尝试绘制一些东西时,它什么也没做。根本没有绘图。



如果我将此下拉菜单切换到Qt,或取消选中激活支持,它只会绘制第一个子图或部分图,以及然后停止:





如何在一个可以与之交互的图中获得4个并排子图的旧行为?

解决方案

将后端更改为自动:



工具>首选项> IPython控制台>图形>图形后端>后端:自动



然后关闭并打开Spyder。


I upgraded from Python(x,y) 2.7.2.3 to 2.7.6.0 in Windows 7 (and was happy to see that I can finally type function_name? and see the docstring in the Object Inspector again) but now the plotting doesn't work as it used to.

Previously (Spyder 2.1.9, IPython 0.10.2, matplotlib 1.2.1), when I plotted this script, for instance, it would plot the subplots side-by-side in an interactive window:

Now (Spyder 2.2.5, IPython 1.2.0, Matplotlib 1.3.1) when I try to plot things, it does the subplots as tiny inline PNGs, which is a change in IPython:

So I went into options and found this:

which seems to say that I can get the old interactive plots back, with the 4 subplots displayed side-by-side, but when I switch to "Automatic", and try to plot something, it does nothing. No plots at all.

If I switch this drop-down to Qt, or uncheck "Activate support", it only plots the first subplot, or part of it, and then stops:

How do I get the old behavior of 4 side-by-side subplots in a single figure that I can interact with?

解决方案

Change the backend to automatic:

Tools > preferences > IPython console > Graphics > Graphics backend > Backend: Automatic

Then close and open Spyder.

这篇关于如何在Spyder / IPython / matplotlib中再次获得交互式图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆