matplotlib / matplotlib/ipympl

rendering issues when exception is raised before cell execution completes

Ouverte
#10 3 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Langage dominant
Jupyter Notebook
Étoiles
1.7k
Forks
234
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

Reposting from jupyter/notebook issue. 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)-
notebook_matplotlib_exception_ipympl
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.

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Reproduisez la cellule Python fournie dans l’intégration de notebooks ipympl avec l’environnement Chrome indiqué, y compris la première exécution, l’exception levée, le redimensionnement de la figure et les niveaux de zoom du navigateur. Comparez le rendu initial aux exécutions suivantes ; c’est terminé lorsque la figure est rendue à la bonne taille et que le rectangle de zoom reste aligné après l’exception sans nécessiter de redimensionnement ni de nouvelle exécution.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
jupyter-notebook, matplotlib, python
Domaine
data-visualization, frontend
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.