matplotlib / matplotlib/ipympl

ipympl for matplotlib not created through pyplot

Aperta
#221 7 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

Is it possible to use ipympl starting from an arbitrary matplotlib figure? If yes, an example would be helpful. Thanks!

Use Case: I would like to use ipympl for SageMath plots. The later do have a method to
convert them to matplotlib figure. However the figure has not been created with the usual
pyplot workflow, and does not have a canvas setup.

In a jupyter notebook with the SageMath kernel (e.g. using the binder link from https://github.com/sagemath/sage-binder-env/ after installing ipympl with sage -pip install ipyml)

%matplotlib widget
p = plot(sin(x))
fig = p.matplotlib();
type(fig.canvas)
<class 'NoneType'>

It could well be that SageMath is producing weird matplotlib figures though.

cc: @zerline

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

Non vengono indicati file del progetto o test. Inizia riproducendo lo snippet del notebook Jupyter con la figura matplotlib prodotta da SageMath e verifica se ipympl può fornire un canvas per essa; il lavoro è completato quando è stato stabilito se questo workflow funziona e sono stati documentati un esempio minimo o la limitazione.

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

Valutazione

Stack tecnologico
jupyter-notebook, python
Ambito
data-visualization, documentation
Tipo di issue
Documentazione
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.