在Spyder IDE中使用Matplotlib绘制内联或单独的窗口 [英] Plot inline or a separate window using Matplotlib in Spyder IDE

查看:764
本文介绍了在Spyder IDE中使用Matplotlib绘制内联或单独的窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用Matplotlib绘制一些图形时,通常适合默认的内联绘图.但是,当我绘制一些3D图形时,我希望将它们放在单独的窗口中,以便可以启用诸如旋转之类的交互.我可以在Python代码中配置要内联显示的图形和在新窗口中显示的图形吗?

When I use Matplotlib to plot some graphs, it is usually fine for the default inline drawing. However, when I draw some 3D graphs, I'd like to have them in a separate window so that interactions like rotation can be enabled. Can I configure in Python code which figure to display inline and which one to display in a new window?

我知道在Spyder中,单击工具",首选项","Ipython控制台",图形",然后在图形后端"下选择自动",而不是内联".但是,这使所有数字均位于新窗口中.当我有很多地块时可能会很混乱.因此,我只希望那些3D图位于新窗口中,而所有其他2D图仍保持内联.可能吗?

I know that in Spyder, click Tools, Preferences, Ipython Console, Graphics and under Graphics Backend select "automatic" instead of "inline". However, this make all the figures to be in new windows. It can be messy when I have a lot of plots. So I want only those 3D plot to be in new windows, but all the other 2D plots remain inline. Is it possible at all?

谢谢!

推荐答案

类型

%matplotlib qt

当您想要在单独的窗口中显示图形时

when you want graphs in a separate window and

%matplotlib inline

当您需要嵌入式绘图时

这篇关于在Spyder IDE中使用Matplotlib绘制内联或单独的窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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