Skip to content

Figure.timestamp: Plot GMT timestamp logo #3646

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
11 of 14 tasks
seisman opened this issue Nov 24, 2024 · 1 comment
Closed
11 of 14 tasks

Figure.timestamp: Plot GMT timestamp logo #3646

seisman opened this issue Nov 24, 2024 · 1 comment
Assignees
Milestone

Comments

@seisman
Copy link
Member

seisman commented Nov 24, 2024

The Figure.timestamp method is a high-level wrapper for GMT's common option -U. With this method, we should disallow -U option in all plotting method.

The syntax of -U

The full syntax of the -U option is:

-U[<label>][+c][+t<text>][+j<just>][+o<dx>[/<dy>]]

There are four GMT defaults that can affect the timestamp logo.

  • MAP_LOGO: controls if a timestamp logo should be plotted [Not implmented since it makes no sense here]
  • MAP_LOGO_POS: defaults to BL/-54p/-54p. It's equivalent to setting the +j and +o modifiers. [Already implmented]
  • FONT_LOGO can control the font ID of the text strings. It's implemented by passing --FONT_LOGO=xxx to the GMT C API. [Add Figure.timestamp to plot the GMT timestamp logo #2208]
  • FORMAT_TIME_STAMP can control the format of the timestamp. It's implemented by passing --FORMAT_TIME_STAMP to the GMT C API. [Add Figure.timestamp to plot the GMT timestamp logo #2208]

Function signature

timestamp(
    text=None, 
    label=None, 
    justify="BL", 
    offset=("-54p", "-54p"), 
    font="Helvetica,black", 
    timefmt="%Y %b %d %H:%M:%S"
)

Implementation notes

  1. The method is implemented by calling gmt plot -T -U...
  2. An upstream bug of the +o modifier for GMT <=6.4.0 (-U doesn't work with a single offset value gmt#7107).
  3. For GMT<=6.4.0, FONT_LOGO can only change the font ID, but since GMT 6.5.0, it can also change both the font ID and color (but not the font size). See Allow FONT_LOGO to change font color gmt#7125
  4. In GMT 6.5.0, a new modifier +t will be added. See Allow FONT_LOGO to change font color gmt#7125.

Issues to track

@seisman seisman self-assigned this Nov 24, 2024
@seisman seisman converted this from a draft issue Nov 24, 2024
@seisman
Copy link
Member Author

seisman commented Nov 24, 2024

Sorry, incorrectly clicked a button. Closing.

@seisman seisman closed this as completed Nov 24, 2024
@github-project-automation github-project-automation bot moved this from 5) Ongoing maintenance to 4) Gallery|tutorial example in PyGMT: Wrapping GMT modules Nov 24, 2024
@seisman seisman changed the title Figure.timestamp Figure.timestamp: Plot GMT timestamp logo Dec 3, 2024
@seisman seisman added this to the 0.9.0 milestone Mar 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 5) Ongoing maintenance
Development

No branches or pull requests

1 participant