Skip to content

WIP: Figure.colorbar: Add alias "no_font_scaling" for "-H" - #4783

Open
yvonnefroehlich wants to merge 1 commit into
mainfrom
add-alias-H-colorbar
Open

WIP: Figure.colorbar: Add alias "no_font_scaling" for "-H"#4783
yvonnefroehlich wants to merge 1 commit into
mainfrom
add-alias-H-colorbar

Conversation

@yvonnefroehlich

@yvonnefroehlich yvonnefroehlich commented Jul 30, 2026

Copy link
Copy Markdown
Member

Description of proposed changes

This PR aims to add an alias for the newly added -H flag of colorbar of GMT 6.7.0. Currently it's no_font_scaling. Feel free to make suggestion for a suitable alias.

TODO

  • Find alias name: no_font_scaling default False
  • Add alias
  • Update note

Related: #4243

Preview: https://pygmt-dev--4783.org.readthedocs.build/en/4783/api/generated/pygmt.Figure.colorbar.html

Example

import pygmt

size = 5
args_bmap = {
    "region": [-size, size] * 2,
    "projection": f"X{size * 2}c",
    "frame": True,
}
args_cb = {
    "cmap": "batlow",
    "position": "jMC+h+w1c",
    "frame": "x+ltitle for a very short cb",
}


fig = pygmt.Figure()

fig.basemap(**args_bmap)
fig.colorbar(**args_cb)

fig.shift_origin(xshift=f"+{size*2+1}c")

fig.basemap(**args_bmap)
fig.colorbar(no_font_scaling=True, **args_cb)

fig.show()

Guidelines

Slash Commands

You can write slash commands (/command) in the first line of a comment to perform
specific operations. Supported slash command is:

  • /format: automatically format and lint the code

@yvonnefroehlich yvonnefroehlich added this to the 0.20.0 milestone Jul 30, 2026
@yvonnefroehlich yvonnefroehlich self-assigned this Jul 30, 2026
@yvonnefroehlich yvonnefroehlich added enhancement Improving an existing feature feature Brand new feature labels Jul 30, 2026
@seisman

seisman commented Jul 30, 2026

Copy link
Copy Markdown
Member

maybe font_scaling with default
to True

@yvonnefroehlich

Copy link
Copy Markdown
Member Author

maybe font_scaling with default to True

Hmmm. Seems we will have fun with double negatives here 😅. My understanding and thoughts so far are:
In GMT, not using -H means the auto-scaling applies. Setting -H turns off the auto-scaling. Setting a flag in GMT without any argument translates in PyGMT to True. So H=True leads to "no auto-scaling is applied". Based on this, the alias for H should contain the "no", with the default False as then no no auto-scaling (i.e., auto-scaling) is applied 😆.

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

Labels

enhancement Improving an existing feature feature Brand new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants