Skip to content
Merged
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions examples/gallery/embellishments/timestamp.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
"""
Timestamp
---------
The :meth:`pygmt.Figure.timestamp` method can draw the
GMT timestamp logo on the map/plot. A custom label
can be added via the ``label`` parameter.
"""

import pygmt

# Define static format string.
pygmt.config(FORMAT_TIME_STAMP="2023-03-01T20:45:15")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to have a static UNIX timestamp string here, because the gallery examples are not tested in the CI.


fig = pygmt.Figure()
Comment thread
michaelgrund marked this conversation as resolved.
fig.timestamp()
fig.show()

# Plot the GMT timestamp logo with a custom label.
Comment thread
michaelgrund marked this conversation as resolved.
Outdated
Comment thread
michaelgrund marked this conversation as resolved.
Outdated
fig = pygmt.Figure()
fig.timestamp(label="Powered by PyGMT")
fig.show()