matplotlib / matplotlib/ipympl

plt.pause uses removed `start_event_loop_default` API

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

还没有人认领这个 Issue。

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

描述

As the title suggests, attempting to pause through matplotlib currently raises an error. The minimum working example is:

%matplotlib widget
from matplotlib import pyplot as plt

plt.plot([1,2,3])
plt.pause(1)    
plt.plot([3,2,1])
plt.close()

This raises an attribute error trying to call FigureCanvasBase.start_event_loop_default. A little googling suggests this function has been removed since version 3.0.

Taking inspiration from #17, I guess the simplest get around is using time.sleep but is there a better solution?

Thanks for your help.

贡献指南

打开贡献指南

从这里开始

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

调研方向

从提供的 Jupyter 示例开始,跟踪 plt.pause 到报告中提到的入口点 FigureCanvasBase.start_event_loop_default,并使用 issue #17 了解相关上下文。完成的标准是:示例运行时不再出现由已移除 API 导致的 AttributeError,并且两个绘图都能按描述显示和关闭。

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

评估

技术栈
jupyter-notebook, python
领域
data-visualization
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

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