Skip to content

Add default reference point for map inset (-D)#9077

Merged
Esteban82 merged 2 commits into
masterfrom
set-default-inset-position
Jun 30, 2026
Merged

Add default reference point for map inset (-D)#9077
Esteban82 merged 2 commits into
masterfrom
set-default-inset-position

Conversation

@Esteban82

Copy link
Copy Markdown
Member

Assisted-by: Claude Sonnet 4.6

This PR makes the argument optional for the map inset option (-D).

When omitted, GMT now defaults to jTL (top-left corner inside the map frame) instead of raising a parsing error.

Test with:

gmt begin ex44 png
	gmt coast -R110E/170E/44S/9S -JM15c -Gbrown -Baf
    gmt inset begin -D+w4c -F+gwhite+p1p+c0.1c+s -Vi
		gmt coast -Rg -JG120/30S/? -Gbrown -Bg
	gmt inset end
gmt end
ex44

Please let me know if you’d prefer a different default setting. In PyGMT the Bottom Left corner is used.

@Esteban82 Esteban82 requested review from a team, joa-quim and seisman June 29, 2026 22:14
@Esteban82 Esteban82 self-assigned this Jun 29, 2026
@Esteban82 Esteban82 added enhancement Improving an existing feature add-changelog Add PR to the changelog AI-assisted All (or most) of the code was written by Artificial Intelligence. labels Jun 29, 2026
@joa-quim

Copy link
Copy Markdown
Member

Maybe it's only my taste, but I would put it at TR (that's what you did in the other PR) or BR

@Esteban82

Copy link
Copy Markdown
Member Author

Yes, I would put it there too, but it would be the same corner used by the directional arrow (in #9074). That's why I chose "top left" so that the default positions wouldn't overlap.

@joa-quim

Copy link
Copy Markdown
Member

Well, in that (very very rare) case the user has to decide where he/she wants to pout each of them.

@Esteban82

Copy link
Copy Markdown
Member Author

I don't think it's that rare to have both an inset and a north arrow on the same map.

But if you insist with TR, I can change it.

@Esteban82

Esteban82 commented Jun 30, 2026

Copy link
Copy Markdown
Member Author

Changed to TR.

@Esteban82 Esteban82 merged commit cd2ce36 into master Jun 30, 2026
8 of 12 checks passed
@Esteban82 Esteban82 deleted the set-default-inset-position branch June 30, 2026 15:29
@yvonnefroehlich

Copy link
Copy Markdown
Member

For PyGMT we have currently the Bottom Left corner of the plot as default

@Esteban82

Copy link
Copy Markdown
Member Author

I have no problem to change it. @joa-quim ?

@joa-quim

joa-quim commented Jul 2, 2026

Copy link
Copy Markdown
Member

GMT.jl has insets too, but more elaborated as they can search best locations, but for full filled base image the default is TR. And the example in the GMT inset page, also set TR as the location. I don't think BL is a common default location for an inset.

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. enhancement Improving an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants