Jupyter notebook 魔法命令之 %matplotlib

今日份学习:jupyter notebook magic
查看可用魔法命令:

# jupyter notebook cell 使用
%lsmagic

查看命令帮助:

# %cmd? 例如:%run? %matplotlib
%run?

Docstring:
Run the named file inside IPython as a program.
Usage::
%run [-n -i -e -G]
[( -t [-N<N>] | -d [-b<N>] | -p [profile options] )]
( -m mod | file ) [args]

%matplotlib?

Docstring:
::
%matplotlib [-l] [gui]
Set up matplotlib to work interactively.
This function lets you activate matplotlib interactive support at any point during an IPython session. It does not import anything into the interactive namespace.
Examples:
To enable the inline backend for usage with the IPython Notebook::
In [1]: %matplotlib inline

今天用到了 %matplotlib inline,功能是使用matplotlib画图时,图片嵌入在jupyter notebook里面,不以单独窗口显示。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容