matplotlib / matplotlib/ipympl
ipympl 0.8.2 - ginput() does not work on Jupyterlab / returns an empty array
还没有人认领这个 Issue。
- 主要语言
- Jupyter Notebook
- 星标
- 1.7k
- 派生
- 234
- PR 合并指标
- 30 天内没有已合并 PR
描述
Describe the bug
I should be able to select data points from a figure and then red crosses are supposed to appear after clicking with the mouse, but nothing happens, an empty array is returned and the figures only appear after the timeout of ginput().
Expected behavior
Figure pops up and I can click with the mouse on the figure to select data points. An array will be generated
To Reproduce
%matplotlib widget
import matplotlib.pyplot as plt
import numpy as np
t = np.arange(10)
plt.plot(t, np.sin(t))
plt.title('matplotlib.pyplot.ginput()\
function Example', fontweight ="bold")
print("After 3 clicks :")
x = plt.ginput(3)
print(x)
plt.show()
My Platform
Firefox on Arch Linux, latest version after system update.
I tested it on Jupyterlab, I did not test it on Jupyter-notebook.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先,在 Firefox 上的 JupyterLab 中使用 %matplotlib widget 后端运行 issue 的最小复现。调查为什么 plt.ginput(3) 返回空数组,并且 figure 只有在 timeout 之后才出现;当鼠标点击产生预期的坐标和红色十字标记时,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- jupyter-notebook
- 领域
- frontend
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100