matplotlib / matplotlib/ipympl

Unable to show figures in VS Code

未關閉
#596 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

主要語言
Jupyter Notebook
星號
1.7k
分支
234
PR 合併指標
30 天內沒有已合併 PR

描述

Describe the issue

In VS Code Jupyter Notebook, after using %matplotlib widget or %matplotlib ipympl, no figures will show.

Minimal example:

# Enabling the `widget` backend.
# This requires jupyter-matplotlib a.k.a. ipympl.
# ipympl can be install via pip or conda.
%matplotlib widget

import matplotlib.pyplot as plt
import numpy as np
# Testing matplotlib interactions with a simple plot
fig = plt.figure()
plt.plot(np.sin(np.linspace(0, 20, 100)))

Image

Versions

 3.13.3 (main, Apr  8 2025, 13:54:08) [Clang 19.1.7 ]
ipympl version: 0.9.7
Selected Jupyter core packages...
IPython          : 9.2.0
ipykernel        : 6.29.5
ipywidgets       : 8.1.7
jupyter_client   : 8.6.3
jupyter_core     : 5.7.2
jupyter_server   : 2.16.0
jupyterlab       : 4.4.2
nbclient         : 0.10.2
nbconvert        : 7.16.6
nbformat         : 5.10.4
notebook         : 7.4.2
qtconsole        : not installed
traitlets        : 5.14.3
JupyterLab v4.4.2
/Volumes/Workspace/be-project/data/.venv/share/jupyter/labextensions
        jupyterlab_pygments v0.3.0 enabled OK (python, jupyterlab_pygments)
        jupyter-matplotlib v0.11.7 enabled OK
        @jupyter-notebook/lab-extension v7.4.2 enabled OK
        @jupyter-widgets/jupyterlab-manager v5.0.15 enabled OK (python, jupyterlab_widgets)

(jupyter nbextension results "Jupyter command jupyter-nbextension not found.")

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

首先,在 VS Code 中使用 %matplotlib widget%matplotlib ipympl,並使用所列出的 Python、ipympl、JupyterLab 和擴充功能版本,重現最小 notebook 範例。將結果與回報的行為進行比較;當互動式圖形在 VS Code 中呈現時,即表示完成。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
jupyter-notebook, numpy, python, vscode
領域
devtools, frontend
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
需要釐清
新手友好度
25/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。