matplotlib / matplotlib/ipympl
Excessive white space / margins with some plots.
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
With the current ipympl 0.9.6 (and probably earlier versions) I am observing excessive white space around axes in some cases when using the `%matplotlib ipympl` mode but not in the `%matplotlib inline` mode.
A small example to reproduce:
````python
%matplotlib ipympl
from matplotlib import pyplot as plt
fig, ax = plt.subplots(figsize=(5, 3), constrained_layout=True)
ax.imshow([[1,2,3],[4,5,6],[7,8,9]])
ax.set_aspect(0.1)
````
This yields:

And the same example in inline mode:
````python
%matplotlib inline
from matplotlib import pyplot as plt
fig, ax = plt.subplots(figsize=(5, 3), constrained_layout=True)
ax.imshow([[1,2,3],[4,5,6],[7,8,9]])
ax.set_aspect(0.1)
````

Especially larger figures then became unmanageable in the `ipympl` backend. Setting `constrained_layout` or using `plt.tight_layout()` does not seem to influence the margins. Can this behavior be influenced?
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, die beiden bereitgestellten Beispiele mit `%matplotlib ipympl` und `%matplotlib inline` auszuführen, einschließlich der Einstellungen für constrained layout und aspect. Vergleiche die resultierenden Ränder und verfolge das Rendering und Layout-Verhalten der ipympl-Figur. Als erledigt gilt die Aufgabe, wenn das ipympl-Beispiel keinen übermäßigen Leerraum um die Achsen mehr erzeugt, auch bei größeren Figuren.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- jupyter-notebook, python
- Bereich
- data-visualization, frontend
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100