matplotlib / matplotlib/ipympl
Figures in Output disappear if Output displayed twice in same cell
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Jupyter Notebook
- Sterne
- 1.7k
- Forks
- 234
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
## 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.

```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```
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Reproduziere das Problem mit dem bereitgestellten Python-Notebook-Beispiel, indem du nach dem Erstellen einer matplotlib-Figur innerhalb eines Output-Widgets zweimal display(o) aufrufst. Vergleiche die erste und die zweite Anzeige mit den aufgeführten Versionen von JupyterLab, ipympl, matplotlib und ipywidgets; als erledigt gilt die Aufgabe, wenn die Figur nach der wiederholten Anzeige sichtbar bleibt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- jupyter-notebook, matplotlib, python
- Bereich
- data-visualization, frontend
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100