Skip to content

Commit abf6f37

Browse files
DOC: Use other image (not the GMT logo) in the gallery example for Figure.image (#3863)
1 parent 52c385f commit abf6f37

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

examples/gallery/images/image.py

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
"""
2-
Images on figures
2+
Image on a figure
33
=================
44
5-
The :meth:`pygmt.Figure.image` method can be used to read and place an image
6-
file in many formats (e.g., png, jpg, eps, pdf) on a figure. We must specify
7-
the filename via the ``imagefile`` parameter or simply use the filename as
8-
the first argument. You can also use a full URL pointing to your desired image.
9-
The ``position`` parameter allows us to set a reference point on the map for
10-
the image.
5+
The :meth:`pygmt.Figure.image` method can be used to read and place an image file in
6+
many formats (e.g., png, jpg, eps, pdf) on a figure. We must specify the filename via
7+
the ``imagefile`` parameter or simply use the filename as the first argument. You can
8+
also use a full URL pointing to your desired image. The ``position`` parameter allows
9+
us to set a reference point on the map for the image.
1110
"""
1211

1312
# %%
@@ -18,16 +17,16 @@
1817
fig = pygmt.Figure()
1918
fig.basemap(region=[0, 2, 0, 2], projection="X10c", frame=True)
2019

21-
# place and center the GMT logo from the GMT website to the position 1/1
22-
# on a basemap, scaled up to be 3 cm wide and draw a rectangular border
23-
# around the image
20+
# Place and center ("+jCM") the image "needle.jpg" provided by GMT to the position
21+
# ("+g") 1/1 on the current plot, scale it to a width of 8 centimeters ("+w") and draw
22+
# a rectangular border around it
2423
fig.image(
25-
imagefile="https://www.generic-mapping-tools.org/_static/gmt-logo.png",
26-
position="g1/1+w3c+jCM",
24+
imagefile="https://oceania.generic-mapping-tools.org/cache/needle.jpg",
25+
position="g1/1+w8c+jCM",
2726
box=True,
2827
)
2928

30-
# clean up the downloaded image in the current directory
31-
Path("gmt-logo.png").unlink()
32-
3329
fig.show()
30+
31+
# Clean up the downloaded image in the current directory
32+
Path("needle.jpg").unlink()

0 commit comments

Comments
 (0)