[ENH]: Consider using a layout engine by default

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

メンテナーはふだん 1 日以内に返信

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

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
静か
技術スタック
python

調査の方向性

まず、issue の議論と、figure(..., layout=None) および fig.set_layout_engine(None) を通じて公開されている既存の constrained_layout の挙動を確認します。プロジェクトが constrained_layout をデフォルトで有効にすることを望んでいるか、後方互換性をどのように扱うか、またリリースノートにどのような指針が必要かを判断します。この設計上の決定が確定し、その移行計画が記録されて初めて、issue は完了となります。

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

説明

API: default changes New feature topic: geometry manager
Problem

By default, Axes are placed at hard-coded positions, which may result in cut-off/overlapping labels.
The recommendation is therefore to use constrained_layout.

This is a usability issue: Bad placement should not happen by default. And manual fixes such as tuning subplot params or explicitly activating a layout engine are cumbersome.

Proposed solution

We should consider activating constrained_layout by default. For most users, having a good layout by default is much more important than exact reproducibility. If you want the old behavior, you can always set figure(..., layout=None / fig.set_layout_engine(None).

This is a classical trade-off between better defaults and full backward-compatibility. There's no clear answer but IMHO it's worth discussing whether the full backward-compatibility for placement is a stronger argument than better usability.

Unfortunately, there is no smooth transition path with a suitable runtime warning. I think the best we could do is to make a statement on upcoming changes in the release notes. At least people wo read that can then can already switch to layout=None, when positioning repoducibility is important. Then, introduce the changes early in one upcoming release cycle, so that people testing against main will notice changes before the change is released.

主要言語
Python
スター
23.5k
フォーク
8.6k
平均マージ
1日 19時間
マージ済み PR(30日)
64

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

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

matplotlib/matplotlib のほかの issue

matplotlib/matplotlib の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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