matplotlib / matplotlib/ipympl

Figures in Output disappear if Output displayed twice in same cell

オープン
#237 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
Jupyter Notebook
スター
1.7k
フォーク
234
PR マージ指標
30日以内にマージされた PR はありません

説明

## Describe the issue
Got an odd one.
If an Output contains a figure, and one calls a single cell containing `display(Output)` twice, the output "empties" and no figure is shown.

Example below. One can emphasise it by first calling `display(o)` in one cell, and then doing the double call (I press ctrl + Enter twice) in another cell. I attach a figure showing the result.
![image](https://user-images.githubusercontent.com/2721423/84801820-f2029c00-afff-11ea-9a5c-12c5c64956c4.png)

```python
# in one cell:
%matplotlib widget
import matplotlib.pyplot as plt
from ipywidgets import Output
o = Output()
with o:
plt.figure()
plt.plot([1,2,3])
# In a separate cell, call this twice after each other
display(o)
```
## Versions

```
3.8.2 | packaged by conda-forge | (default, Mar 23 2020, 17:32:17) [MSC v.1916 64 bit (AMD64)]
ipympl version: 0.5.6
jupyter core : 4.6.3
jupyter-notebook : 6.0.3
qtconsole : 4.7.2
ipython : 7.13.0
ipykernel : 5.2.0
jupyter client : 6.1.3
jupyter lab : 2.1.4
nbconvert : 5.6.1
ipywidgets : 7.5.1
nbformat : 5.0.4
traitlets : 4.3.3
Known nbextensions:
config dir: C:\Users\thomasaar\.jupyter\nbconfig
notebook section
default_cells disabled
config dir: C:\Users\thomasaar\.conda\envs\py5\etc\jupyter\nbconfig
notebook section
ipyvolume/extension enabled
- Validating: ok
jupyter-webrtc/extension enabled
- Validating: ok
jupyter-matplotlib/extension enabled
- Validating: ok
plotlywidget/extension enabled
- Validating: ok
jupyter-js-widgets/extension enabled
- Validating: ok
tree section
ipyparallel/main enabled
- Validating: ok
JupyterLab v2.1.4
Known labextensions:
app dir: C:\Users\thomasaar\.conda\envs\py5\share\jupyter\lab
@jupyter-widgets/jupyterlab-manager v2.0.0 enabled ok
@jupyter-widgets/jupyterlab-sidecar v0.5.0 enabled ok
jupyter-matplotlib v0.7.2 enabled ok```

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

提供された Python ノートブック例で問題を再現し、Output ウィジェット内に matplotlib の図を作成した後、display(o) を 2 回呼び出します。リストされた JupyterLab、ipympl、matplotlib、ipywidgets のバージョンを使用して 1 回目と 2 回目の表示を比較します。繰り返し表示した後も図が表示されたままであれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
jupyter-notebook, matplotlib, python
領域
data-visualization, frontend
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。