Plot into Pycharm#39;s IPython console(绘图到 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 控制台的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:绘图到 Pycharm 的 IPython 控制台


基础教程推荐
- 如何在海运重新绘制中自定义标题和y标签 2022-01-01
- 线程时出现 msgbox 错误,GUI 块 2022-01-01
- 在 Python 中,如果我在一个“with"中返回.块,文件还会关闭吗? 2022-01-01
- Dask.array.套用_沿_轴:由于额外的元素([1]),使用dask.array的每一行作为另一个函数的输入失败 2022-01-01
- 使用PyInstaller后在Windows中打开可执行文件时出错 2022-01-01
- 用于分类数据的跳跃记号标签 2022-01-01
- 如何让 python 脚本监听来自另一个脚本的输入 2022-01-01
- Python kivy 入口点 inflateRest2 无法定位 libpng16-16.dll 2022-01-01
- 何时使用 os.name、sys.platform 或 platform.system? 2022-01-01
- 筛选NumPy数组 2022-01-01