Repository navigation
Fix upside-down x/y annotations in perspective views - #9303
Merged
Merged
Conversation
gmt_xy_axis rotated x/y annotations by 180 degrees whenever cos(azimuth) > 0, which is only right for text running along the map x-direction. Annotations parallel to the y-axis (MAP_ANNOT_ORTHO without w/e), orthogonal x-axis annotations (MAP_ANNOT_ORTHO with s/n) and +a slanted ones came out upside down for some azimuths, e.g. the y annotations of -pz60/30 in test/psbasemap/rotalign.sh, the case reported in the old forum topic 7776. Decide the flip from the actual text angle: rotate when the projected text direction cos(angle + azimuth) points right-to-left, breaking exact ties so vertical text reads upward. For angle 0 this reproduces the old cos(az) > 0 test, so the default annotations are unchanged. Drop the known-failure flag from rotalign.sh and add its baseline. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Summary of changed imagesThis is an auto-generated report of images that have changed on the DVC remote
Image diff(s)Report last updated at commit 0a27ca6 |
joa-quim
approved these changes
Nov 17, 2026
joa-quim
left a comment
Member
There was a problem hiding this comment.
OK, but we don't see how it was before this fix.
Member
Author
Member
|
Ah, ok. |
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.



In
-pviewsgmt_xy_axisflipped x/y annotations whenever cos(azimuth) > 0, so y-axis annotations parallel to the axis (and orthogonal/+a ones) came out upside down for some azimuths. The flip is now decided from the actual text angle; default annotations are unchanged.Removes the
GMT_KNOWN_FAILUREflag frompsbasemap/rotalign.shand adds its baseline.Tested with:
gmt psbasemap -R0/5/0/20/0/10 -JX3.5i/5i -JZ3i -Bxa1+l"x-axis" -Bya5+l"y-axis" -Bza2+l"z-axis" -BEWSNZ -pz60/30 --MAP_ANNOT_ORTHO= -png rotalignOutput with this fix:
Not covered: -px/-py wall views, and the related flips in oblique geographic annotations and the horizontal y-axis +L label, left for separate PRs.
Written with Claude Opus 5.5.