Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Figures in Output disappear if Output displayed twice in same cell

Abierto
#237 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
jupyter-notebook, matplotlib, python

Línea de trabajo

Reproduce el problema con el ejemplo de notebook de Python proporcionado, llamando a display(o) dos veces después de crear una figura de matplotlib dentro de un widget Output. Compara la primera y la segunda visualización usando las versiones indicadas de JupyterLab, ipympl, matplotlib e ipywidgets; se considera terminado cuando la figura permanece visible después de la visualización repetida.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

# 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```
Lenguaje dominante
Jupyter Notebook
Estrellas
1.7k
Forks
234
Métricas de merge de PR
Sin PR fusionados en 30 d

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de matplotlib/ipympl

Todos los issues de matplotlib/ipympl

Issues similares

Más issues de Data Visualization

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.