Fix #8993 "-Ba5f1g1+0.5, grid offset affects grid, minor and major/annotated tick positions" - #9159
Merged
Conversation
-B intervals are documented as a string of [a|f|g][stride][phase][unit] substrings, and gmtinit_decode_tinfo does parse each substring on its own. But gmtinit_set_titem then stored the phase on the axis, "phase must apply to entire axis", and every consumer read it from there. A phase written on g was therefore applied to the annotations, both tick series, the fancy-frame checkers and the annotation format as well, so -Ba5f1g1+0.5 shifted the whole frame and the documented result needed two basemap calls. phase moves from GMT_PLOT_AXIS into GMT_PLOT_AXIS_ITEM, so each of the eight items carries its own, and the layout code is handed the phase of the item it is drawing: gmtlib_coordinate_array uses T->phase, gmtlib_pow_array and the gridline drawers take it as an argument (gmt_linearx_grid is public and also called from psscale, which passes item[GMT_GRID_UPPER].phase), the checkers use the tick item they already have, and the decimal-count logic in gmt_xy_axis consults item[GMT_ANNOT_UPPER].phase since only an annotation phase can add digits. GMT_PLOT_AXIS.phase is deleted rather than left in place, so the compiler pointed at every site that used to read it. This changes behavior: a script relying on the axis-wide shift restores its plot by repeating the phase, -Ba5+0.5f1+0.5g1+0.5 for -Ba5f1g1+0.5. The two tests that relied on the old reading, psxy/units.sh and pscoast/pscoast_180.sh, are updated that way so their baselines still match. test/psbasemap/axis_phase.sh compares the single-call frame with the two-call sequence, so it needs no PostScript baseline. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Member
Esteban82
approved these changes
Aug 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Example in issue page now works fine and no secondary failures were detected.
gmt basemap -R0/10/0/10 -Ba5f1g1+0.5 -JX5c -png all_ticks_offsetFix #8993
Assisted by GPT Terra, revised by Claude Opus 5.0