Need to create and update figures in seperate cells?
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- jupyter, jupyter-notebook, python
- Ambito
- data-visualization, frontend
Direzione di ricerca
L’issue non indica alcun file o test del repository. Inizia riproducendo in JupyterLab gli esempi con celle separate e celle combinate, quindi confronta l’effetto di update_function, che ha una lunga durata, sul rendering. Il lavoro è completato quando la cella combinata aggiorna la figura come richiesto, oppure quando l’issue documenta una limitazione confermata e il relativo workaround corretto.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Something I've seen in previous versions as well as the current version: In order to have a figure that dynamically updates while some code is executing (e.g. tracking the loss function of an optimization), I have to create the figure in a separate jupyter notebook cell and run it before a I run the code that updates. If I don't do this, then a blank figure shows and never updates. I'm using Jupyter lab. Wondering if I'm doing something wrong here? It would make the code cleaner and easier to run if it could all be put in a single cell.
Example:
Using the following function:
def update_function(fig, ax):
while True:
# Do some computation
ax.clear() #clear previously drawn
ax.plot(some_data)
fig.canvas.draw() #force it to update
This works:
# cell 1
fig, ax = plt.subplots()
# cell 2
update_function(fig, ax)
But this does not:
# one combined cell
fig, ax = plt.subplots()
update_function(fig, ax)
- Lingua principale
- Jupyter Notebook
- Stelle
- 1.7k
- Fork
- 234
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di matplotlib/ipympl
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
matplotlib/ipympl#623 · 1 commento ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
matplotlib/ipympl#622 · 13 commenti ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
matplotlib/ipympl#612 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
matplotlib/ipympl#611 · 4 commenti ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
matplotlib/ipympl#609 · 6 commenti ·
Tutte le issue di matplotlib/ipympl
Issue simili
-
Urgent request: Due to vulnerabilities move to API version 12.6.1 (12.6.2 eventually) or 13.1.1 Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
jbkunst/highcharter#849 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
equinor/energyvision#4027 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
bancolombia/sentinel#23 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
AOSSIE-Org/OrgExplorer#245 · 1 assegnatario ·
-
tech-debt
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100