Skip to content

Fix incorrect time annotations near year boundaries#9096

Merged
Esteban82 merged 1 commit into
masterfrom
fix-8865_B-time-axis
Jul 10, 2026
Merged

Fix incorrect time annotations near year boundaries#9096
Esteban82 merged 1 commit into
masterfrom
fix-8865_B-time-axis

Conversation

@Esteban82

Copy link
Copy Markdown
Member

Done with Claude Sonnet 5

Test with:

gmt basemap -JX15c/10c -B -f0T --TIME_EPOCH=0000-01-01T --TIME_UNIT=y -R2025.96T/2027.04T/17.2/20.2 -png lixo1
lixo1

And gmt basemap -JX15c/10c -B -f0T --TIME_EPOCH=0000-01-01T --TIME_UNIT=y -R2026.00136986T/2026.99863014T/17.2463856192/20.0914327114 -png lixo2
lixo2

Closes #8865

@Esteban82 Esteban82 requested review from a team and joa-quim July 9, 2026 16:37
@Esteban82 Esteban82 added add-changelog Add PR to the changelog AI-assisted All (or most) of the code was written by Artificial Intelligence. labels Jul 9, 2026
@joa-quim

joa-quim commented Jul 9, 2026

Copy link
Copy Markdown
Member

The case is more complex than this. See #8937 I will need to come to this and decisions must be taken (#8937 discuss it if I still remember). And, I want a Opus or Fable analysis on this. Not Sonnet only.

@Esteban82

Copy link
Copy Markdown
Member Author

I’ve had a look at it. I’m not sure it’s the same problem. I get the impression it isn’t.

@Esteban82

Copy link
Copy Markdown
Member Author

I still think this is a different issue. This PR fixes the case where a fractional date is used in the region specification.

Test with:

I tested it with the command below, using 2026.997 and 2027.01 as the region limits.

gmt basemap -JX15c/10c -B -f0T --TIME_EPOCH=0000-01-01T --TIME_UNIT=y -R2026.997T/2027.01T/17/20 -png lixo3

Without this fix

GMT truncates the fractional part of the dates and ends up using a region covering the entire year 2026.

lixo3_previo

With this fix

The resulting range is just over 5 days, which is the expected behavior.

lixo3_fixed

@joa-quim joa-quim left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, let's get in in and see where it fits in this list of time annotations troubles.

@Esteban82 Esteban82 merged commit 2ab24f9 into master Jul 10, 2026
10 of 14 checks passed
@Esteban82 Esteban82 deleted the fix-8865_B-time-axis branch July 10, 2026 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

add-changelog Add PR to the changelog AI-assisted All (or most) of the code was written by Artificial Intelligence.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

-B with a time axis adds a full year from a tinny fraction of a year

2 participants