Closing a figure from the notebook does not close the python figure
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
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- javascript, jupyter-notebook, python
Direzione di ricerca
Inizia da js/src/mpl_widget.js, in particolare dalla funzione di rimozione dal DOM e dalla gestione del pulsante di chiusura del widget descritte nell’issue. Riproduci il problema eseguendo ripetutamente la cella del grafico e chiudendo esplicitamente il widget, quindi verifica che il numero di figure, l’uso della memoria e l’avviso relativo a più di 20 figure non aumentino più.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
This is essentially a regression of https://github.com/matplotlib/matplotlib/issues/4841 which happened when the nbagg backend was converted to a widget.
To reproduce create a cell with a simple plot.
plt.plot(range(10))
plt.show()
re execute the cell and observe that the figure count goes up and memory consumption goes up too. If you continue doing this you will eventually have more than 20 open figures and matplotlib will print a warning even if you only have one figure displayed.
The same is true if you explicitly close the widget using the widget close cross on the left of the figure.
I have spent some time trying to figure out how to best fix this but don't really know how to best do this. This function
is meant to trigger a close message to the python side when the figure is removed from the DOM but no longer works.
The old no longer existing close button is also intended to send a close signal to the python layer but this is not hooked up to the widget close button.
https://github.com/matplotlib/matplotlib/issues/6414 has some more related issues.
- 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
-
triage/confirmed
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
agentscope-ai/agentscope#2775 ·
-
area/sessions comp/cron comp/gateway P2 sweeper:risk-message-delivery sweeper:risk-session-state type/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
NousResearch/hermes-agent#118863 ·
-
needs-triage🔍
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
StackExchange/StackExchange.Redis#3249 ·