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

查看:52
本文介绍了绘图到 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 笔记本.当在 .ipynb(iPython/Jupyter 文件格式)脚本中定义时,PyCharm 支持 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 inline,它位于 matplotlib.pyplot 导入之后.

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天全站免登陆