Colourbar label overlaps the bar in small figures

オープン 初心者向け
#629 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
75/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python

調査の方向性

ColorMapperを見つけて、cax.yaxis.set_label_coordsを呼び出している箇所を確認してください。issueでは、座標が固定されているため、小さな図でラベルがバーに重なると指摘されています。指定された幅3.4 × 高さ2.6インチの図とフォントサイズ8で再現し、提案されている方法のいずれかを使ってラベルの配置を調整してください。このサイズでラベルがバーや目盛りラベルに重ならなくなれば完了です。

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

説明

ColorMapper places the label with cax.yaxis.set_label_coords(-0.9, 0.5),
which is in units of the bar's width. The bar width scales with the figure
but the text does not, so in a small figure the label is drawn on top of
the bar and its tick labels:

import matplotlib.pyplot as plt, plopp as pp

with plt.rc_context({'font.size': 8}):
    fig = pp.plot(pp.data.data2d(), figsize=(3.4, 2.6))
fig.save('small.png')

Suggestion: let matplotlib place the label (set_label_position('right')
with no fixed coordinates), or give the offset in points.

Reproduced on plopp 26.11.0, scipp 26.9.0, matplotlib 3.11.2.

主要言語
Python
スター
12
フォーク
7
平均マージ
16時間 5分
マージ済み PR(30日)
6

環境構築

はじめの一歩

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

scipp/plopp のほかの issue

scipp/plopp の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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