display `print` in callbacks in the notebook
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 35/100
- Issue 類型
- 功能
- 描述清晰度
- 基本清楚
- 活躍度
- 停滯
- 技術堆疊
- jupyter, jupyter-notebook, python
研究方向
該 issue 提供了一個使用 fig.canvas.mpl_connect 的 Python 回呼,以及一個使用 ipywidgets.Output 的替代方案;首先使用 ipympl 在 JupyterLab 中重現遺失的 print 輸出,並將其與 IPython 進行比較。當 matplotlib 回呼中的 print 輸出無需將回呼包裝在 Output 內容中即可自動顯示在 notebook 中時,即表示完成。
由索引模型根據 Issue 內容生成。
描述
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
n = 0
def printer(event):
global n
print(f'in event {event}')
n += 1
fig.canvas.mpl_connect('button_press_event', printer)
when run in IPython prints out to stdout on every mouse click. In jlab + ipympl the prints don't show up anywhere I can find...
From https://ipywidgets.readthedocs.io/en/stable/examples/Output%20Widget.html it looks like this can work via:
output = widgets.Output()
display(fig.canvas, output)
n = 0
def printer(event):
global n
with output:
print(f'in event {event}')
n += 1
fig.canvas.mpl_connect('button_press_event', printer)
but I suspect there is a way for this to work automatically....
- 主要語言
- Jupyter Notebook
- 星號
- 1.7k
- 分支
- 236
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
matplotlib/ipympl 的其他 Issue
-
難度 4/5 3-5 天 新手友好度 35/100
matplotlib/ipympl#623 · 1 則留言 ·
-
難度 4/5 3-5 天 新手友好度 35/100
matplotlib/ipympl#622 · 13 則留言 ·
-
難度 4/5 3-5 天 新手友好度 42/100
matplotlib/ipympl#612 ·
-
DeprecationWarning: Passing unrecognized arguments to super(Toolbar).__init__().可能已有人在做 @pradeep14012004 於 6 天前認領。 未關閉
難度 3/5 1-2 天 新手友好度 45/100
matplotlib/ipympl#611 · 4 則留言 ·
-
難度 4/5 3-5 天 新手友好度 42/100
matplotlib/ipympl#609 · 7 則留言 ·
查看 matplotlib/ipympl 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 78/100
zerocracy/judges-action#2714 ·
維護者通常 8 天內回覆
-
MMM.budget_optimizer rejects a DataFrame cost_per_unit despite its signature可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉
難度 2/5 1-3 小時 新手友好度 72/100
pymc-labs/pymc-marketing#3140 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 75/100
syedhamidali/radarx#198 ·
維護者通常 1 天內回覆
-
Duplicated and inconsistent feature-value rounding loop in shap/plots/_bar.py可能已有人在做 @adt-kmr 於 1 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 75/100
維護者通常 5 天內回覆
-
Integration:azure_functions needs:triage Team:Obs-InfraObs
難度 2/5 1-3 小時 新手友好度 78/100
elastic/integrations#21931 ·
維護者通常 1 天內回覆