matplotlib / matplotlib/ipympl

(Auto-)Resize plots that start too large

Aperta
#431 7 commenti 2 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

Plots by default are sometimes too large, and the right side is cut off (e.g. when using the sexy Jupyter Lab side-by-side rendering or just using a small screen. Obviously you then want to resize them. However, since the resize handle is at the bottom right, it is also not visible. So the only current solution is to manually change the figure size in the code and re-run until it is visible. Not an ideal solution; sometimes you may not have direct access to the code creating the figure.

Some possible solutions:

  • add a horizontal scrollbar (probably would need to be done on the JupyterLab side)
  • introduce an auto-resize feature in the ipympl figure toolbar that will automatically resize the figure to the available width when pressed
  • auto resize all newly created figures, maybe activatable by an "%ipympl autoresize" magic method
  • make the handle location configurable
  • scale the entire figure such that all of it is always visible (probably doesn't work too well with manual resizing), just like for inline plots

The current state is rather frustrating.

Example:
image

Versions

jupyterlab==3.2.8
jupyterlab-widgets==1.0.2
ipympl==0.8.7
ipywidgets==7.6.5

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 esaminando la barra degli strumenti delle figure di ipympl e il modo in cui JupyterLab visualizza figure affiancate. Confronta gli approcci proposti per rendere utilizzabile un grafico sovradimensionato, quindi definisci il comportamento previsto durante il ridimensionamento e verificalo nelle versioni indicate di JupyterLab, ipywidgets e ipympl; l’issue non indica file o test.

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

Valutazione

Stack tecnologico
jupyter, jupyter-notebook
Ambito
data-visualization, frontend
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.