matplotlib / matplotlib/ipympl

make `%matplotlib widget` behave like `inline`?

未关闭
#171 11 条评论 10 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
Jupyter Notebook
星标
1.7k
派生
234
PR 合并指标
30 天内没有已合并 PR

描述

I have a notebook in Jupyter Lab, so far using the default matplotlib backend, which in this context I believe is inline. When I have a sequence of plotting commands (pyplot.plt etc.), they combine into a figure that is shown after the respective code cell. Also, @interact works as expected.

I now wanted to zoom in, which inline does not support, so I issued %matplotlib widget. The figures are now zoomable alright, but I don't have that neat behavior where plotting code in one cell contributed to the following figure output cell, and doesn't modify anything else. And @interact, instead of producing new (versions of) a figure, now puts everything on top of each other.

From reading around I realize that this is the intended behavior. The thing is, I don't like it. So my question is: Is there a way to make widget behave like inline?

If there is not, is there a guide that tells me how to modify my code so that plot commands affect only the next output cell, and @interact updates instead of adds?

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先在 Jupyter Lab 中使用 %matplotlib widget、连续的绘图命令和 @interact 重现该行为,然后将其与默认的 inline backend 进行比较。确定是否可以支持所请求的单元格范围输出和更新交互;完成的标准是记录一种受支持的方法,或明确确定所需的行为变更。

由索引模型根据 Issue 内容生成。

评估

技术栈
jupyter, jupyter-notebook
领域
developer-experience, frontend
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。