Skip to content

Fix upside-down x/y annotations in perspective views - #9303

Merged
Esteban82 merged 1 commit into
masterfrom
fix-rotalign-3d
Nov 17, 2026
Merged

Esteban82 merged 1 commit into
masterfrom
fix-rotalign-3d

Conversation

@Esteban82

@Esteban82 Esteban82 commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

In -p views gmt_xy_axis flipped 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_FAILURE flag from psbasemap/rotalign.sh and 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 rotalign

Output with this fix:

rotalign_2

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.

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>
@Esteban82 Esteban82 added bug Something isn't working maintenance Boring but important stuff for the core devs labels Nov 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Summary of changed images

This is an auto-generated report of images that have changed on the DVC remote

Status Path
added test/baseline/psbasemap/rotalign.ps
modified test/baseline/psbasemap/

Image diff(s)

Details

Added images

  • test/baseline/psbasemap/rotalign.png

Modified images

Path Old New

Report last updated at commit 0a27ca6

@Esteban82
Esteban82 requested review from a team, joa-quim and seisman November 17, 2026 19:19

@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, but we don't see how it was before this fix.

@Esteban82

Copy link
Copy Markdown
Member Author

OK, but we don't see how it was before this fix.

The numbers in the y-axis were upside down.

rotalign

@Esteban82
Esteban82 merged commit bb4d986 into master Nov 17, 2026
11 of 18 checks passed
@Esteban82
Esteban82 deleted the fix-rotalign-3d branch November 17, 2026 19:34
@joa-quim

Copy link
Copy Markdown
Member

Ah, ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working maintenance Boring but important stuff for the core devs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants