Displaying a previously created Matplotlib figure in a widget
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
- jupyter-notebook, matplotlib, python
- Ambito
- data-visualization, frontend
Direzione di ricerca
Scarica ed esegui l’Output Example Notebook collegato per riprodurre il comportamento con la figura creata in precedenza, l’Output widget e HBox. Inizia tracciando come vengono gestiti la figura visualizzata e il relativo canvas, quindi verifica che la figura mantenga l’interattività di ipympl in HBox e che la visualizzazione di fig1 non sollevi più l’errore NoneType segnalato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I'm trying to find a way to take a figure previously created, and show it inside a widget, without losing interactivity.
Here's a short version of my approach (which may not be the right one):
fig = plt.figure() # previously created figure
out = widgets.Output()
with out:
display(fig)
# other things happening
display(widgets.HBox([fig.canvas, some_other_fig]))
If I first create a figure in the notebook outside of an Output widget, and then wish to include it later inside something like an HBox next to a second figure, I seem to lose interactivity with the figure (including the nice ipympl zoom interface).
Here is a nbviewer view of a MWE notebook I created, download it top right on the window. It's best if one downloads it and runs it since the first figure appears buggy in the nbviewer.
Additionally, and I might create a new issue for this - if I call fig1 at the end of the notebook, I get an unexpected error. Here I'd expect the regular figure to be shown. The error is AttributeError: 'NoneType' object has no attribute '_send_event'.
- 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 · 7 commenti ·
Tutte le issue di matplotlib/ipympl
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
duplicate invalid
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
anthropics/claude-code#96312 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
palladius/ricc.rocks#7 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
pydata/pydata-sphinx-theme#2503 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
unitaryfoundation/metriq-gym#828 ·