matplotlib / matplotlib/pytest-mpl

Paramater `remove_text` in `mpl_image_compare` decorator does not remove axis labels

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

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

主要言語
Python
スター
272
フォーク
53
PR マージ指標
30日以内にマージされた PR はありません

説明

When choosing remove_text=True I would have assumed that the text for axis labels was removed along with the axis ticks and any titles. But it doesn't seem to do that.

The code uses remove_ticks_and_titles from matplotlib and that does not appear to remove the axis labels (See matplotlib documentation).

I'd propose updating the remove_text conditional as follows:


if remove_text:
    remove_ticks_and_titles(fig)
    for ax in fig.get_axes():
        ax.set_xlabel = ""
        ax.set_ylabel = ""

If this seems reasonable, I can submit a PR.

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

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

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

調査の方向性

まず mpl_image_compare デコレーターとその remove_text 条件を見つけ、次に既存の remove_ticks_and_titles 呼び出しが軸ラベルにどのような影響を与えるかを調べます。画像比較テストで動作を確認し、remove_text=True のときに目盛りとタイトルだけでなく軸ラベルも除外されれば、提案されたラベル削除の動作が完了したものとします。

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

評価

技術スタック
python
領域
testing
issue の種類
バグ
難易度
2/5
見積もり時間
1〜3時間
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

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

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