Skip to content

Better way to configure axis (instead of B/frame) #249

Closed

Description

@leouieda

Description of the desired feature

Currently, tickmarks, titles, axis labels, gridlines and others are all set using the frame argument (-B ). This leads to huge unreadable strings and sometimes even to multiple entries for frame (which we handle via lists right now).

There should be a better way of doing this. In GMT.jl, they have added an axis function that creates the string for you. Alternatively, we could add set_xlabel style methods to gmt.Figure. I don't think this will work because that's not how GMT handles things. We would have to hold on to these arguments and pass them along to a later module call.

What we could do is add xlabel, title etc arguments to gmt.Figure which would be converted to one or more -B entries. They would be stored and passed along to the first method call. The same could be done for projection, region, X and Y. One drawback is that the argument list for Figure would get quite large and the complexity of creating a new figure would also increase. Another drawback is the our Figure isn't really a figure. GMT draws things on a canvas and so every single plotting command can have it's own axes.

The best option might be to have a Frame/Axes class or function that converts sane arguments (xlabel, title, grid) into the correct -B. We could optionally allow the frame argument to be a dictionary, which we would pass along to our function/class.

Activity

  1. added this to the 0.19.0 milestone on Apr 15, 2026
  2. seisman commented on Apr 15, 2026

    @seisman
    Member

    We have implemented the Frame/Axis classes for frame settings. The progress will be tracked in issue #4588.

    I'm closing this eight-year-old issue.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature request

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions