Skip to content

Commit 5c38521

Browse files
DOC/Gallery example "Scale bar": Migrate frame settings to the new Frame/Axis syntax (#4513)
1 parent 2a14b76 commit 5c38521

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

examples/gallery/embellishments/scalebar.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,17 @@
88

99
# %%
1010
import pygmt
11-
from pygmt.params import Box, Position
11+
from pygmt.params import Axis, Box, Frame, Position
1212

1313
# Create a new Figure instance
1414
fig = pygmt.Figure()
1515

1616
# Mercator projection with 10 centimeters width
17-
fig.basemap(region=[-45, -25, -15, 0], projection="M0/0/10c", frame=["WSne", "af"])
17+
fig.basemap(
18+
region=[-45, -25, -15, 0],
19+
projection="M0/0/10c",
20+
frame=Frame(axes="WSne", axis=Axis(annot=True, tick=True)),
21+
)
1822

1923
# --- Top Left: Add a plain scale bar ---
2024
# It is placed based on geographic coordinates 42° West and 1° South, applies at the
@@ -67,7 +71,11 @@
6771

6872
fig = pygmt.Figure()
6973

70-
fig.basemap(region=[-45, -25, -15, 0], projection="M10c", frame=["WSne", "af"])
74+
fig.basemap(
75+
region=[-45, -25, -15, 0],
76+
projection="M10c",
77+
frame=Frame(axes="WSne", axis=Axis(annot=True, tick=True)),
78+
)
7179
fig.coast(land="tan", water="steelblue")
7280
fig.scalebar(
7381
position=Position("BL", cstype="inside", offset=1),

0 commit comments

Comments
 (0)