matplotlib / matplotlib/ipympl
rendering issues when exception is raised before cell execution completes
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
Reposting from [jupyter/notebook issue](https://github.com/jupyter/notebook/issues/2166#issuecomment-280676430). The code cell as appears in the screen shot is:
```
import ipympl
import matplotlib.pyplot as plt
def plot_something():
plt.figure()
plt.plot([0,2],[0,2],'-')
plt.show()
plot_something()
raise Exception
```
The behavior I am seeing is different for the first time I run the cell and the next times. It is also different for different level of browser zoom levels (I am using Chrome 56.0.2924.87 on Windows 8.1)-
First time that the cell is run -
The figure appears but is not fully rendered (see image)-

If I then resize the figure using the GUI (bottom right corner), the behavior changes based on browser zoom level-
1. When using 100% zoom level (default), the figure is rendered too small. When in this state the zoom rectangle is drawn offset from the mouse pointer. The zooming is determined by the mouse pointer, it is just the drawing of the rectangle that is off.
2. When using 90% zoom level (ctrl^- once), the figure is rendered to size and the zoom rectangle is working fine.
When I rerun the cell the figure is re-rendered properly without need for resizing and independent of zoom level.
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Reproduce la celda de Python proporcionada en la integración de notebooks de ipympl con el entorno de Chrome indicado, incluyendo la primera ejecución, la excepción producida, el cambio de tamaño de la figura y los niveles de zoom del navegador. Compara el renderizado inicial con las ejecuciones posteriores; se considera completado cuando la figura se renderiza con el tamaño correcto y el rectángulo de zoom permanece alineado después de la excepción sin requerir un cambio de tamaño ni volver a ejecutar.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- jupyter-notebook, matplotlib, python
- Área
- data-visualization, frontend
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100