Skip to content

Add default position for map scales when refpoint is omitted#9079

Merged
Esteban82 merged 4 commits into
masterfrom
set_scale_default_position
Jul 1, 2026
Merged

Add default position for map scales when refpoint is omitted#9079
Esteban82 merged 4 commits into
masterfrom
set_scale_default_position

Conversation

@Esteban82

Copy link
Copy Markdown
Member

Assisted by Claude Sonnet 4.6

This PR adds a default placement for map scales when refpoint is omitted. The scale is automatically placed in the lower-right corner of the map (+jBR+o0.5c), slightly offset from the frame.

Testing
gmt basemap -R0/10/0/1 -JM10c -Baf -L+f+w150k -png test

test

Let me know if you prefer another position.

@Esteban82 Esteban82 requested review from a team, joa-quim and seisman July 1, 2026 01:10
@Esteban82 Esteban82 self-assigned this Jul 1, 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 Jul 1, 2026
@joa-quim

joa-quim commented Jul 1, 2026

Copy link
Copy Markdown
Member

Hmm, sorry disagreeing again but this is a case where the default must clearly be LL.

@Esteban82

Copy link
Copy Markdown
Member Author

Ok. I will change to LL. Thanks for the feedback.

@Esteban82

Copy link
Copy Markdown
Member Author

I just changed to jBL.

@Esteban82

Copy link
Copy Markdown
Member Author

Now I got this figure.
test

@yvonnefroehlich

Copy link
Copy Markdown
Member

In PyGMT we have for the high-level method Figure.scalebar:

If not specified, defaults to the Bottom Left corner of the plot with a 0.2-cm and 0.4-cm offset in the x- and y-directions, respectively.

as default.

@Esteban82

Copy link
Copy Markdown
Member Author

Okay, I'll update the offset with those values. I suspect they were intended to be higher than the one I used. Thanks Yvonne for letting me know.

@Esteban82

Copy link
Copy Markdown
Member Author

Offset changed.

gmt basemap -R0/10/0/2 -JM10c -Baf -L+f+w150k -png test

test

@Esteban82 Esteban82 merged commit 8efbbac into master Jul 1, 2026
9 of 13 checks passed
@Esteban82 Esteban82 deleted the set_scale_default_position branch July 1, 2026 16:06
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.

4 participants