matplotlib / matplotlib/ipympl

Excessive white space / margins with some plots.

オープン
#586 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
Jupyter Notebook
スター
1.7k
フォーク
234
PR マージ指標
30日以内にマージされた PR はありません

説明

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:

%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:

Image

And the same example in inline mode:

%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)

Image

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?

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、%matplotlib ipympl%matplotlib inline を使用して、提供されている2つの例を実行します。constrained layout と aspect の設定も含めてください。結果の余白を比較し、ipympl の figure のレンダリングとレイアウトの動作を追跡します。ipympl の例で、より大きな figure を含め、axes の周囲に過剰な空白が生じなくなれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
jupyter-notebook, python
領域
data-visualization, frontend
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。