matplotlib / matplotlib/ipympl

Running a cell producing a plot for a second time, and the plot fails to display

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

Nadie ha tomado este issue todavía.

Lenguaje dominante
Jupyter Notebook
Estrellas
1.7k
Forks
234
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

## Describe the issue
When using `ipympl` with the `%matplotlib widget` magic, I can successfully display a plot. Rerunning the cell with the plot however, fails to re-display the figure.

![iRxF6Xmk1U](https://user-images.githubusercontent.com/1473646/220138005-90c8a582-b0c3-4ef6-8916-ee087a406088.gif)

the following is visible in the error console

![image](https://user-images.githubusercontent.com/1473646/220138091-f726ee14-136d-44d1-9949-698e2f5d206b.png)

Note: that adding `plt.show()` to the cell and re-running does display a plot **however** the color of the line in the plot is different, suggesting that this is a new (second) matplotlib figure and not the original.

## Versions

```

3.8.10 | packaged by conda-forge | (default, May 10 2021, 22:58:09)
[Clang 11.1.0 ]
ipympl version: 0.9.3
Selected Jupyter core packages...
IPython : 8.10.0
ipykernel : 6.21.2
ipywidgets : 8.0.4
jupyter_client : 8.0.3
jupyter_core : 5.2.0
jupyter_server : 2.3.0
jupyterlab : 3.5.3
nbclient : 0.7.2
nbconvert : 7.2.9
nbformat : 5.7.3
notebook : 6.5.2
qtconsole : not installed
traitlets : 5.9.0
Known nbextensions:
config dir: /Users/stevejpurves/.jupyter/nbconfig
notebook section
jupyter-js-widgets/extension enabled
- Validating: OK
config dir: /Users/stevejpurves/miniconda3/envs/em_recharge/etc/jupyter/nbconfig
notebook section
bqplot/extension enabled
- Validating: OK
ipyevents/extension enabled
- Validating: OK
ipysheet/extension enabled
- Validating: OK
ipytree/extension enabled
- Validating: OK
jupyter-leaflet/extension enabled
- Validating: OK
jupyter-matplotlib/extension enabled
- Validating: OK
jupyter-js-widgets/extension enabled
- Validating: OK
JupyterLab v3.5.3
/Users/stevejpurves/miniconda3/envs/em_recharge/share/jupyter/labextensions
ipytree v0.2.2 enabled OK
jupyterlab_pygments v0.2.2 enabled OK (python, jupyterlab_pygments)
bqplot v0.5.37 enabled OK (python, bqplot)
jupyter-matplotlib v0.11.3 enabled OK
jupyter-leaflet v0.17.2 enabled OK
ipysheet v0.7.0 enabled OK (python, ipysheet)
ipyevents v2.0.1 enabled OK
@jupyter-widgets/jupyterlab-manager v5.0.5 enabled OK (python, jupyterlab_widgets)
```

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.

Línea de trabajo

Comienza reproduciendo la repetición de la celda `%matplotlib widget` reportada en JupyterLab con ipympl y, después, compara la consola de errores del navegador y la figura que se muestra en la primera y segunda ejecución. No se nombran archivos fuente ni pruebas; se considera terminado cuando volver a ejecutar la celda muestra de forma fiable la figura original sin requerir `plt.show()` ni crear una segunda figura con colores diferentes.

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

Evaluación

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

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.