Skip to content

Do not rescale a fixed-size subplot panel -J taken from history - #9307

Merged
Esteban82 merged 2 commits into
masterfrom
subplot-fixed-J
Nov 18, 2026
Merged

Esteban82 merged 2 commits into
masterfrom
subplot-fixed-J

Conversation

@Esteban82

@Esteban82 Esteban82 commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

In a subplot panel, a map drawn with a fixed-size -J (e.g. -JM15c) is not rescaled to the panel, as documented. But the next modules that take -J from the history (plot, text, legend, ...) did rescale it, so they no longer lined up with the map.

Tested with:

gmt begin fixedJoverlay png
	gmt subplot begin 1x1 -Fs15c/10c -B -BWSne
		gmt coast -R10W/5E/35N/44N -JM15c -Wfaint -N1/1p -Dh -c0
		echo -9.14 38.72 | gmt plot -Sc0.3c -Gred -W0.5p -JM15c 
		echo -9.14 38.72 | gmt plot -Sc0.3c -Gred -W0.5p
	gmt subplot end
gmt end

Both red circle should be on Lisbon, but on master it lands inland.

fixedJoverlay

This also adds test/subplot/fixedJoverlay.sh, which needs no baseline: it checks that a circle plotted with -JM15c and one plotted with -J from history end up at the same place in the PostScript.

🤖 Generated using Claude Opus 5.5.

When a panel map is drawn with a fixed-size -J (e.g. -JQ8c) it is not
rescaled to fit the panel, but later modules that take -J from the
history (plot, legend, ...) still rescaled it, so they no longer lined
up with the map. Remember this in the panel history (@n).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Esteban82
Esteban82 requested review from a team, joa-quim and seisman November 18, 2026 12:29
@Esteban82 Esteban82 added the bug Something isn't working label Nov 18, 2026
The test measures positions and deletes its PostScript, but gmtest gives
any script that spells out "gmt begin" a $ps to compare and fails when it
is missing. Spell the start command via $start, as subplot_3d_fit.sh does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Esteban82
Esteban82 merged commit 274264b into master Nov 18, 2026
16 of 19 checks passed
@Esteban82
Esteban82 deleted the subplot-fixed-J branch November 18, 2026 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants