首页
学习
活动
专区
工具
TVP
发布

Jupyter的Matplotlib 交互图表扩展

利用 Jupyter 交互式小部件框架,jupyter-matplotlib 可以在 Jupyter notebook 和 Jupyterlab 中实现 matplotlib 的交互功能。

此外,canvas 是一个合适的 Jupyter 交互式小部件,可以定位在交互部件的 Layout 上。

Github 链接:

https://github.com/matplotlib/jupyter-matplotlib

用法:

要启用 jupyter-matplotlib 后端,只需使用 matplotlib:

%matplotlib widget

示例:

安装:

使用 conda 安装 ipympl:

condainstall-c conda-forge ipympl

#Ifusingthe Notebook

condainstall-c conda-forge widgetsnbextension

#IfusingJupyterLab

condainstallnodejs

jupyter labextensioninstall@jupyter-widgets/jupyterlab-manager

使用pip安装ipympl:

pipinstallipympl

#IfusingJupyterLab

#Installnodejs: https://nodejs.org/en/download/

jupyter labextensioninstall@jupyter-widgets/jupyterlab-manager

对于开发安装(需要节点)

git clone https://github.com/matplotlib/jupyter-matplotlib.git

cd jupyter-matplotlib

pipinstall-e .

jupyter nbextensioninstall--py --symlink --sys-prefix ipympl

jupyter nbextensionenable--py --sys-prefix ipympl

jupyter labextensioninstall@jupyter-widgets/jupyterlab-manager--no-build

jupyter labextensionlink./js

cd js && npm run watch

# Launch jupyterlabas`jupyter lab --watch`inanother terminal

  • 发表于:
  • 原文链接https://kuaibao.qq.com/s/20180730A08XUH00?refer=cp_1026
  • 腾讯「腾讯云开发者社区」是腾讯内容开放平台帐号(企鹅号)传播渠道之一,根据《腾讯内容开放平台服务协议》转载发布内容。
  • 如有侵权,请联系 cloudcommunity@tencent.com 删除。

扫码

添加站长 进交流群

领取专属 10元无门槛券

私享最新 技术干货

扫码加入开发者社群
领券