matplotlib / matplotlib/ipympl

Notebook rendered with Voila does not show Axes in a matplotlib widget

Aperta
#412 2 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

## Describe the issue
When rendering a notebook using Voila, the interactive matplotlib widget using ipympl backend is also rendered. However this widget is completely missing the Axes, therefore not showing any data at all.

A minimum reproducible code would be
```python
%matplotlib widget

plt.ioff()
figRHF = plt.figure(figsize=(10, 5))
figRHF.canvas.layout.min_height = '400px'
axRHF = figRHF.gca()
test = axRHF.plot([0, 1], [0, 1])
print(axRHF)
print(figRHF)
print(figRHF.gca())
print(test)

display(
figRHF.canvas
)
```
And this is the output from this code, on the left is the Jupyter Lab notebook output, on the right is the Voila output
![image](https://user-images.githubusercontent.com/33886395/147021040-3b849394-3769-447c-be5f-ce369d45e3c9.png)

## Versions

```
'3.8.12 | packaged by conda-forge | (default, Oct 12 2021, 21:22:46) [MSC v.1916 64 bit (AMD64)]'
ipympl version: 0.8.2

Selected Jupyter core packages...
IPython : 7.29.0
ipykernel : 6.5.0
ipywidgets : 7.6.5
jupyter_client : 6.1.12
jupyter_core : 4.9.1
jupyter_server : 1.11.2
jupyterlab : 3.2.4
nbclient : 0.5.9
nbconvert : 6.3.0
nbformat : 5.1.3
notebook : 6.4.6
qtconsole : not installed
traitlets : 5.1.1

Known nbextensions:
config dir: C:\Users\are014\Miniconda3\envs\humaninjurymodel\etc\jupyter\nbconfig
notebook section
ipydatetime/extension enabled
jupyter-matplotlib/extension enabled
voila/extension enabled
jupyter-js-widgets/extension enabled

- Validating: ok
- Validating: ok
- Validating: ok
- Validating: ok

JupyterLab v3.2.4
C:\Users\are014\Miniconda3\envs\humaninjurymodel\share\jupyter\labextensions
jupyter-matplotlib v0.10.2 enabled ok
@jupyter-widgets/jupyterlab-manager v3.0.1 enabled ok (python, jupyterlab_widgets)
@voila-dashboards/jupyterlab-preview v2.1.0 enabled ok (python, voila)

Other labextensions (built into JupyterLab)
app dir: C:\Users\are014\Miniconda3\envs\humaninjurymodel\share\jupyter\lab
jupyter-widget-datetime v1.2.0 enabled ok

```

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

Inizia eseguendo l’esempio minimo riproducibile con le versioni indicate di ipympl, JupyterLab, ipywidgets e Voila, quindi confronta l’output del widget in JupyterLab e Voila. Il lavoro è completato quando il widget matplotlib renderizzato da Voila mostra i suoi Axes e i dati tracciati come in JupyterLab.

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

Valutazione

Stack tecnologico
jupyter-notebook, 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
42/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.