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

Abierto
#9,330 0 comentarios 1 reacción 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@seisman ya está trabajando en esto.

Desde el 1/12/2026.

  • #9362 de @seisman — abierto

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
55/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
c

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
C
Estrellas
997
Forks
420
Merge medio
13 h 27 min
PR fusionados (30 d)
47

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de GenericMappingTools/gmt

Todos los issues de GenericMappingTools/gmt

Issues similares

Más issues de C

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.