histogram: the min/max setting in -T is ignored when -R is set

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

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

@seisman がすでに取り組んでいます。

2026年12月1日 から。

  • #9362 @seisman による — オープン

評価

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

調査の方向性

Start by tracing how gmt histogram handles -T bin boundaries together with -R range settings; the issue provides reproducible commands using @v3206_06.txt. Check the behavior both for separate histogram commands and within gmt subplot. Done when the specified -T min/max determine the bins despite -R, and the second histogram's range history does not unexpectedly affect the first or later plot.

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

説明

bug

The issue was initially reported in https://github.com/GenericMappingTools/pygmt/pull/4988#issuecomment-7068207682 by @yvonnefroehlich.

As per the documentation of -T:

Make evenly spaced array of bin boundaries from min to max by inc.

So, I expect the following commands should produce the same bins but with different ranges:

gmt begin hist png
gmt histogram @v3206_06.txt -T-5000/1000/250 -W1p -Baf -Xw+1c
gmt histogram @v3206_06.txt -T-5000/1000/250 -R-7000/1000/0/0 -W1p -Baf -Xw+1c
gmt end show

but the output is:
hist

it seems the min/max settings in -T is override by min/max in -R.

Another possible issue/limitation is, when two histograms are drawn, it seems the -R history of the first histogram will affect the 2nd histogram:
This can be verified by switching the order of the two histogram commands in the above script. It produces:
hist

The issue doesn't exist if drawing the two histograms using gmt subplot:

gmt begin hist png
    gmt subplot begin 1x2 -Fs10c/10c
        gmt histogram @v3206_06.txt -T-5000/1000/250 -W1p -Baf -c
        gmt histogram @v3206_06.txt -T-5000/1000/250 -R-7000/1000/0/0 -W1p -Baf -c
    gmt subplot end
gmt end show

The output is:

hist

The first issue should be easy to solve with help from Claude, but the 2nd issue is likely more difficult.

主要言語
C
スター
997
フォーク
420
平均マージ
13時間 27分
マージ済み PR(30日)
47

環境構築

はじめの一歩

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

GenericMappingTools/gmt のほかの issue

GenericMappingTools/gmt の issue をすべて見る

似ている issue

C の issue をもっと見る

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

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