matplotlib / matplotlib/ipympl

rendering issues when exception is raised before cell execution completes

Aperta
#10 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
Jupyter Notebook
Stelle
1.7k
Fork
234
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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)-
![notebook_matplotlib_exception_ipympl](https://cloud.githubusercontent.com/assets/721123/22962876/5eed393c-f358-11e6-8d84-047a50ace0d7.jpg)
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.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Riproduci la cella Python fornita nell’integrazione dei notebook di ipympl con l’ambiente Chrome indicato, includendo la prima esecuzione, l’eccezione sollevata, il ridimensionamento della figura e i livelli di zoom del browser. Confronta il rendering iniziale con le esecuzioni successive; il lavoro è completato quando la figura viene visualizzata alla dimensione corretta e il rettangolo di zoom rimane allineato dopo l’eccezione senza richiedere un ridimensionamento o una nuova esecuzione.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
jupyter-notebook, matplotlib, python
Ambito
data-visualization, frontend
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.