matplotlib / matplotlib/ipympl

figures that start in background tabs are cut off at bottom

Aperta
#158 0 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

I'm having some trouble with figures getting cut off at the bottom when they're included in tabs other than the first tab. Here's a minimal example. Note that I put the figures in boxes because I have the same problem as #126 if I don't.

%matplotlib widget
import matplotlib.pyplot as plt
plt.ioff()
import ipywidgets as widgets
import numpy as np
fig1,ax1 = plt.subplots()
ax1.scatter(np.arange(10),np.random.random(10))
ax1.set_xlabel('x axis')
ax1.set_ylabel('y axis')
fig2,ax2 = plt.subplots()
ax2.plot(np.arange(10),np.random.random(10))
ax2.set_xlabel('x axis')
ax2.set_ylabel('y axis')
tabs = widgets.Tab(children=[widgets.Box([fig1.canvas]),widgets.Box([fig2.canvas])])
tabs.set_title(0, 'fig1')
tabs.set_title(1, 'fig2')
tabs

The first tab looks like (I clicked on the figure to show the boundaries)
Screen Shot 2019-12-31 at 3 29 47 PM
and the second tab looks like:
Screen Shot 2019-12-31 at 3 31 00 PM
I just cannot figure out why the bottom of that second figure is getting cut off.

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 di notebook con due schede ipywidgets e figure matplotlib, quindi confronta le dimensioni della seconda figura, inizialmente nascosta, con quelle della prima. Traccia il modo in cui vengono stabilite le dimensioni della figura quando la seconda scheda diventa visibile. Il lavoro è completato quando le figure in ogni scheda mostrano l'intera area del grafico senza essere tagliate.

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

Valutazione

Stack tecnologico
jupyter, jupyter-notebook, python
Ambito
data-visualization, frontend
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.