matplotlib / matplotlib/ipympl

Plot output with ipywidgets formatting incorrectly

Offen
#436 5 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
Jupyter Notebook
Sterne
1.7k
Forks
234
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Describe the issue

I built a small GUI within a notebook and had two figures in an ipywidgets HBox object. the latest version of ipympl made it so I could not have both figures in an HBox and generally disrupted the formatting of the object. I was able to fix the issue by reverting both matplotlib and the ipympl versions.

a short script that generates the broken output is as follows

%matplotlib widget
from IPython.display import display, HTML
display(HTML("<style>.container { width:100%!important;}</style>"))

import ipywidgets as ipy
import matplotlib.pyplot as plt
import numpy as np
out1 = ipy.Output()
b1 = ipy.Button(description = 'button1')
b2 = ipy.Button(description = 'button2')
x = np.linspace(0,7,21)
y = np.sin(x)
with out1:
    fig,ax = plt.subplots()
    ax.plot(x,y)
    
display(ipy.HBox([out1,ipy.VBox([b1,b2])]))

Versions

(working version)

ipympl == 0.5.8
matplotlib == 3.3.3

(broken version)

matplotlib == 3.5.1

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Führen Sie das bereitgestellte Notebook-Skript mit den aufgeführten funktionierenden und fehlerhaften matplotlib/ipympl-Versionen aus und vergleichen Sie anschließend das HBox-Layout und die Widget-Formatierung. Als erledigt gilt die Aufgabe, wenn die Abbildung und die Schaltflächen unter den betroffenen Versionen gemeinsam korrekt in der HBox gerendert werden.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
jupyter-notebook, matplotlib, python
Bereich
frontend
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.