Skip to content

Migrate frame settings to the new Frame/Axis syntax across examples and docs #4494

Closed

Description

@seisman

PyGMT now supports the newer Frame/Axis syntax for frame settings (#4406), although it is still not feature-complete. However, many examples and documentation pages continue to use the legacy string- or list-based frame arguments. It would be beneficial to migrate these usages so that the codebase consistently demonstrates and promotes the newer syntax.

I'm still debating whether to continue supporting string-style frame settings (e.g., frame="WSen", frame="afg"), considering that they're simple and widely used. However, at a minimum, list-style frame settings should be migrated to the Frame/Axis classes.

For example:

  • frame=["xa10", "ya5", "+tTitle"] => frame=Frame(xaxis=Axis(annot=10), yaxis=Axis(annot=5), title="Title")

To locate remaining usages of string- or list-based frame settings, you can use:

  • grep -R 'frame="' **/*.py
  • grep -R 'frame=\[' **/*.py

Contributions are welcome! A good way to help would be to:

  1. Identify files or cases that still use string or list-based frame arguments
  2. Update them to use Frame/Axis where appropriate
  3. Verify that the updated examples render correctly
  4. Submit small, focused PRs

Below is a list of files that still use the list-based frame settings:

Activity

  1. added this to the 0.19.0 milestone on Apr 4, 2026
  2. added
    help wanted
    maintenance
    on Apr 4, 2026
  3. seisman commented on Apr 11, 2026

    @seisman
    MemberAuthor

    @Chuan1937 @yvonnefroehlich I've asked @copilot to work on the issue, then we can focus on reviewing.

  4. seisman commented on Apr 13, 2026

    @seisman
    MemberAuthor
  5. seisman commented on Apr 14, 2026

    @seisman
    MemberAuthor

    I was working on examples/intro/03_figure_element.py in PR #4584, but the result does not look ideal. I think this tutorial needs a new design.

  6. yvonnefroehlich commented on Apr 14, 2026

    @yvonnefroehlich
    Member

    I was working on examples/intro/03_figure_element.py in PR #4584, but the result does not look ideal. I think this tutorial needs a new design.

    Jupp, also found yesterday night that updating this intro will be not straight forward.

  7. removed
    help wanted
    on Apr 29, 2026
  8. seisman commented on Apr 29, 2026

    @seisman
    MemberAuthor

    I think we're done with the migration. The only one left is the Intro Tutorial for figure elements, which will be addressed in #4610.

    Closing.

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

Metadata

Metadata

Labels

maintenance

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions