Skip to content

Commit c81f9b6

Browse files
DOC: Add gallery example for PyGMT logo (#4715)
1 parent 68c600f commit c81f9b6

2 files changed

Lines changed: 63 additions & 0 deletions

File tree

examples/gallery/embellishments/gmt_logo.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
========
44
55
The :meth:`pygmt.Figure.logo` method allows to place the GMT logo on a figure.
6+
For plotting the PyGMT logo, see :doc:`PyGMT logo </gallery/embellishments/pygmtlogo>`.
67
"""
78

89
# %%
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
"""
2+
PyGMT logo
3+
==========
4+
Beside the :doc:`GMT logo </gallery/embellishments/gmt_logo>`, there is a specific logo
5+
for PyGMT which can be plotted and added to a figure using
6+
:meth:`pygmt.Figure.pygmtlogo`. The design of the logo itself is kindly provided by
7+
`@sfrooti <https://github.com/sfrooti>`_ and consists of an icon and the wordmark
8+
"PyGMT".
9+
10+
The visual logo is available in circle and hexagon shapes. It supports both colored and
11+
monochrome black-and-white palettes, alongside light and dark theme modes, combining to
12+
yield eight distinct standalone logo variants. Additionally, the visual logo can
13+
optionally include the wordmark "PyGMT"; if enabled, the wordmark can be positioned
14+
either to the right of the icon or beneath it.
15+
"""
16+
17+
# %%
18+
import pygmt
19+
from pygmt.params import Frame
20+
21+
# %%
22+
# Plot the PyGMT logo without any arguments.
23+
24+
fig = pygmt.Figure()
25+
fig.pygmtlogo()
26+
fig.show()
27+
28+
29+
# %%
30+
# Via the ``color``, ``theme``, ``shape`` parameters the appereance of the logo can be
31+
# changed.
32+
33+
fig = pygmt.Figure()
34+
fig.basemap(region=[-1, 1] * 2, projection="X5c/5c", frame=Frame(fill="180/199/231"))
35+
36+
fig.pygmtlogo(color=False, position="TL")
37+
38+
fig.pygmtlogo(theme="dark", position="TR")
39+
40+
fig.pygmtlogo(color=False, theme="dark", position="BL")
41+
42+
fig.pygmtlogo(shape="hexagon", position="BR")
43+
44+
fig.show()
45+
46+
47+
# %%
48+
# Via the ``wordamrk`` parameter the text "PyGMT" can be added on the right side or at
49+
# the bottom of the visual. Use the ``width`` and ``height`` parameters to adjust the
50+
# size of the logo.
51+
52+
fig = pygmt.Figure()
53+
fig.basemap(region=[-1, 1] * 2, projection="X7c/5c", frame=Frame(fill="180/199/231"))
54+
55+
fig.pygmtlogo(wordmark="horizontal", position="TC", width="6c")
56+
57+
fig.pygmtlogo(theme="dark", wordmark="vertical", position="BC", height="3c")
58+
59+
fig.show()
60+
61+
62+
# sphinx_gallery_thumbnail_number = 1

0 commit comments

Comments
 (0)