GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Figure.subplot: Add parameters tag/tag_box/tag_position/tag_orientation/tag_number_style/tag_font for controlling subplot tagging by seisman · Pull Request #4313 · GenericMappingTools/pygmt

Conversation

@seisman

@seisman seisman commented Dec 20, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

This PR provides a more Pythonic implementation for the -A option of subplot by splitting it into multiple parameters.

The full syntax is:

-A[autotag][+cdx[/dy]][+gfill][+j|Jrefpoint][+odx[/dy]][+ppen][+r|R][+s[[dx/dy][/shade]]][+v]

In PyGMT, the Pythonic parameters are:

  • autotag: autotag [Previously it's called autolabel, but I feel it should be called autotag or tag]
  • [+cdx[/dy]][+gfill][+ppen][+s[[dx/dy][/shade]]]: tag_box. Controls the box outline. It's a subset of the existing Box class, so we can directly pass a Box object!
  • [+j|Jrefpoint][+odx[/dy]]: tag_position, use the Position class
  • +r|R: tag_number_style
  • +v: tag_orientation
  • FONT_TAG: tag_font

It's a POC PR, and is not complete or final yet. Here is an example usage:

import pygmt
from pygmt.params import Box

fig = pygmt.Figure()
with fig.subplot(
    nrows=2, ncols=2, subsize=(5, 5), 
    autotag="(1)", 
    tag_box=Box(pen="1p,red", fill="lightblue"), 
    tag_position="TL", 
    tag_orientation="vertical",
    tag_number_style="roman",
    tag_font="12p,blue"
):
    for i in range(4):
        fig.basemap(region=[0, 10, 0, 10], projection="X?", panel=True)
fig.show()

Preview: https://pygmt-dev--4313.org.readthedocs.build/en/4313/api/generated/pygmt.Figure.subplot.html#pygmt.Figure.subplot

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@seisman seisman added the enhancement Improving an existing feature label Dec 20, 2025
@seisman
seisman force-pushed the subplot/A branch from beeaa71 to a795a64 Compare December 20, 2025 12:51
@seisman
seisman force-pushed the subplot/A branch from a795a64 to 8502e3b Compare January 10, 2026 06:23
@seisman seisman added this to the 0.19.0 milestone Jan 18, 2026
@seisman
seisman force-pushed the subplot/A branch 2 times, most recently from 4b6a925 to c95883c Compare January 19, 2026 07:16
@seisman
Figure.subplot: Pythonic implemention for the subplot tagging
9087c6e
@seisman
seisman force-pushed the subplot/A branch from c95883c to 9087c6e Compare January 19, 2026 07:23
@seisman
seisman force-pushed the subplot/A branch from 9087c6e to 6938abb Compare January 27, 2026 07:06
@seisman seisman mentioned this pull request Jan 27, 2026
Figure 3: Update with new Figure.subplot syntax GenericMappingTools/pygmt-paper-figures#32
Merged
@seisman
Figure.subplot: Pythonic implemention for the subplot tagging
6a05085
@seisman
seisman force-pushed the subplot/A branch from 6938abb to 6a05085 Compare January 28, 2026 02:56
seisman added 7 commits January 30, 2026 17:43
@seisman
Merge branch 'main' into subplot/A
72671b7
@seisman
Checking tag_position and tag_box
b316a22
@seisman
Add doctests
58e8044
@seisman
Merge remote-tracking branch 'origin/subplot/A' into subplot/A
7675235
@seisman
Update tests and gallery examples
7096da6
@seisman
Fix the validation logic for tag_position
8340829
@seisman
Rename test_subplot_autolabel_margins_title.png.dvc -> test_subplot_a…
9d27178
…utotag_margins_title.png.dvc
@seisman seisman changed the title POC: Figure.subplot: Pythonic implemention for the subplot tagging Figure.subplot: Add parameters autotag/tag_box/tag_position/tag_orientation/tag_number_style/tag font for controlling subplot tagging Jan 31, 2026
@seisman seisman added the needs review This PR has higher priority and needs review. label Jan 31, 2026
seisman added 4 commits February 5, 2026 11:46
@seisman
Merge branch 'main' into subplot/A
d91d395
@seisman
Fix conflicts
0c7de28
@seisman
Add more tests
89e4e88
@seisman
Improve comments
c3a3282
@seisman
seisman marked this pull request as ready for review February 5, 2026 04:02
@seisman
Fix type hints
af724ea
@seisman

seisman commented Feb 5, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

@GenericMappingTools/pygmt-maintainers I think this PR is ready for final reviews. Please read the top post for the implementation details.

I'm still debating about the parameter name autotag. Previously, the -A option was aliased to autolabel. This PR splits it into multiple parameters autotag/tag_box/tag_position/tag_number_style/tag_orientation/tag_font. Following our naming conventions, autotag should be auto_tag, but I'm debating if we should just call it tag, and also rename Figure.set_panel's fixedlabel parameter to tag, too. I feel tag makes the parameters more consistent:

The new syntax would be like:

with fig.subplot(nrows=2, ncols=2, tag="(a)"):
    with fig.set_panel(tag="AnyTag"):
        ...

So, tag="(a)" in Figure.subplot sets the tag for the first subplot, and other subplots are automatically tagged, while tag="AnyTag" sets the tag for a specified panel.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Feb 5, 2026

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
renamed pygmt/tests/baseline/test_subplot_autolabel_margins_title.png -> pygmt/tests/baseline/test_subplot_autotag_margins_title.png

Image diff(s)

Details

Added images

Modified images

Path Old New

Report last updated at commit 0c7de28

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Feb 5, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

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
renamed pygmt/tests/baseline/test_subplot_autolabel_margins_title.png -> pygmt/tests/baseline/test_subplot_tag_margins_title.png

Image diff(s)

Details

Added images

Modified images

Path Old New

Report last updated at commit b24ca35

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@yvonnefroehlich yvonnefroehlich mentioned this pull request Feb 5, 2026
Figure.subplot / Figure.set_panel: Deprecate parameters autolabel / fixedlabel to tag (Will be removed in v0.21.0) #4275
Closed
@seisman
Merge branch 'main' into subplot/A
a002c23
@seisman seisman changed the title Figure.subplot: Add parameters autotag/tag_box/tag_position/tag_orientation/tag_number_style/tag font for controlling subplot tagging Figure.subplot: Add parameters autotag/tag_box/tag_position/tag_orientation/tag_number_style/tag_font for controlling subplot tagging Feb 6, 2026
seisman added 2 commits February 6, 2026 15:22
@seisman
Merge branch 'main' into subplot/A
76bee1e
@seisman
Merge branch 'main' into subplot/A
a009dac
@yvonnefroehlich

yvonnefroehlich commented Feb 6, 2026

Copy link
Copy Markdown
Member

I'm still debating about the parameter name autotag. Previously, the -A option was aliased to autolabel. This PR splits it into multiple parameters autotag/tag_box/tag_position/tag_number_style/tag_orientation/tag_font. Following our naming conventions, autotag should be auto_tag, but I'm debating if we should just call it tag, and also rename Figure.set_panel's fixedlabel parameter to tag, too. I feel tag makes the parameters more consistent:

The new syntax would be like:

with fig.subplot(nrows=2, ncols=2, tag="(a)"):
    with fig.set_panel(tag="AnyTag"):
        ...

So, tag="(a)" in Figure.subplot sets the tag for the first subplot, and other subplots are automatically tagged, while tag="AnyTag" sets the tag for a specified panel.

I like the consistency, and tag is shorter compared to the current names.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

yvonnefroehlich
yvonnefroehlich reviewed Feb 6, 2026
View reviewed changes
Comment thread pygmt/src/subplot.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

seisman and others added 6 commits February 7, 2026 12:56
@seisman
Rename autotag to tag
1f15907
@seisman @yvonnefroehlich
Fix a typo
1f7af38
Co-authored-by: Yvonne Fröhlich <[email protected]>
@seisman
Fix tests
d652e01
@seisman
Merge remote-tracking branch 'origin/subplot/A' into subplot/A
f768117
@seisman
Improve docstrings
81ae0ee
@seisman
Rewrap to 88 characeters
0c85280
@seisman

seisman commented Feb 7, 2026

Copy link
Copy Markdown
Member Author

I'm still debating about the parameter name autotag. Previously, the -A option was aliased to autolabel. This PR splits it into multiple parameters autotag/tag_box/tag_position/tag_number_style/tag_orientation/tag_font. Following our naming conventions, autotag should be auto_tag, but I'm debating if we should just call it tag, and also rename Figure.set_panel's fixedlabel parameter to tag, too. I feel tag makes the parameters more consistent:
The new syntax would be like:

with fig.subplot(nrows=2, ncols=2, tag="(a)"):
    with fig.set_panel(tag="AnyTag"):
        ...

So, tag="(a)" in Figure.subplot sets the tag for the first subplot, and other subplots are automatically tagged, while tag="AnyTag" sets the tag for a specified panel.

I like the consistency, and tag is shorter compared to the current names.

I've renamed autotag to tag, and will rename fixedlabel to tag in a separate PR (so that we can have an entry in the changelog.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@seisman seisman added final review call This PR requires final review and approval from a second reviewer and removed needs review This PR has higher priority and needs review. labels Feb 7, 2026
@seisman
Merge branch 'main' into subplot/A
48ccdf9
@seisman seisman mentioned this pull request Feb 7, 2026
Figure.set_panel: Deprecate parameter 'fixedlabel' to 'tag' (Will be removed in v0.23.0) #4393
Merged
@yvonnefroehlich yvonnefroehlich added the deprecation Deprecating a feature label Feb 7, 2026
@seisman seisman changed the title Figure.subplot: Add parameters autotag/tag_box/tag_position/tag_orientation/tag_number_style/tag_font for controlling subplot tagging Figure.subplot: Add parameters tag/tag_box/tag_position/tag_orientation/tag_number_style/tag_font for controlling subplot tagging Feb 8, 2026
@seisman

seisman commented Feb 8, 2026

Copy link
Copy Markdown
Member Author

I plan to merge this PR in 24 hours if no further comments.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

seisman added 3 commits February 9, 2026 01:27
@seisman
Merge branch 'main' into subplot/A
6020654
@seisman
Split tests for tag_box and tag_position
719ce8e
@seisman
Merge branch 'main' into subplot/A
b24ca35
@seisman
seisman merged commit 83f06c3 into main Feb 9, 2026
19 of 22 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@seisman
seisman deleted the subplot/A branch February 9, 2026 14:38
@seisman seisman removed the final review call This PR requires final review and approval from a second reviewer label Feb 9, 2026
@seisman seisman removed the deprecation Deprecating a feature label Apr 11, 2026
@seisman seisman mentioned this pull request Sep 24, 2026
Figure.subplot: Manage modern mode figure subplot configuration and selection #4245
Closed
13 of 21 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@yvonnefroehlich yvonnefroehlich yvonnefroehlich left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

enhancement Improving an existing feature

Projects

None yet

Milestone

0.19.0

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@seisman @yvonnefroehlich
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.