绘制到Pycharm的IPython控制台 [英] Plot into Pycharm's IPython console

查看:207
本文介绍了绘制到Pycharm的IPython控制台的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用spyder和pycharm进行python编码。当我在spyder中使用matplotlib绘制内容时,它会在IPython中显示内联结果。
使用Pycharm IPython绘制一个新的额外窗口。
我正在使用Windows7和Anaconda Python2.7。

I'm using spyder and pycharm for python coding. When I plot something with matplotlib in spyder it shows the result inline in IPython. With Pycharm IPython plots in a new extra window. I'm working on Windows7 and with Anaconda Python2.7.

是否可以在IPython shell中的Pycharm中进行绘图?

Is it possible to plot in Pycharm inside in the IPython shell?

推荐答案

不在shell内;但是,您可以在PyCharm(2016+)中使用iPython笔记本来实现此目的。 PyCharm支持在 .ipynb (iPython / Jupyter文件格式)脚本中定义的iPython图。

Not inside the shell; however, you can use an iPython notebook within PyCharm (2016+) for that purpose. PyCharm supports iPython plots when defined within a .ipynb (iPython/Jupyter file format) script.

以下是一个示例:
打开或创建(如图所示) .ipynb 脚本:

Here is an example: Open, or create (as shown) a .ipynb script:

如果你这是你得到的在PyCharm 2016或更高版本中新建的 .ipynb 文件中的代码。注意%matplotlib内联,它出现在 matplotlib.pyplot import之后。

An here is what you get if you code inside a freshly made .ipynb file within PyCharm 2016 or later. Notice the %matplotlib inline, which comes after matplotlib.pyplot import.

这篇关于绘制到Pycharm的IPython控制台的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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