matplotlib / matplotlib/ipympl
Nesting into HBox collapses plot width
まだ誰も着手していません。
- 主要言語
- Jupyter Notebook
- スター
- 1.7k
- フォーク
- 234
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
Here's another effect of requiring the canvas size explicitly, but somehow isn't visible unless the plot gets dropped into an ipywidgets layout (e.g. by a downstream package).
If the interactive matplotlib is the child of one p-Panel, it's fine. But gets squashed as the child of two p-Panels (regardless of orientation).
Explicitly setting canvas.layout.width fixes it, and propagates to the front-end as expected.
```
from ipywidgets import HTML, HBox, VBox
from matplotlib.figure import Figure
from ipympl.backend_nbagg import Canvas, FigureManager
figure = Figure()
canvas = Canvas(figure)
canvas.manager = FigureManager(canvas, 0)
axes = figure.add_subplot(1,1,1)
HBox([HBox([HTML(''), canvas])])
```
```
HBox([canvas])
```


コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
提供された Canvas/FigureManager の再現コードを notebook で開始し、1つの HBox に入れた canvas と、2つの HBoxes にネストした同じ canvas を比較します。canvas のサイズが ipywidgets のレイアウトにどのように伝播されるかを調査します。明示的に canvas.layout.width を設定せずに、ネストした場合でもプロットの幅が維持されれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- jupyter-notebook, matplotlib, python
- 領域
- frontend
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100