Skip to content
Merged
Changes from all 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
14 changes: 11 additions & 3 deletions examples/gallery/embellishments/scalebar.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@

# %%
import pygmt
from pygmt.params import Box, Position
from pygmt.params import Axis, Box, Frame, Position

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

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

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

fig = pygmt.Figure()

fig.basemap(region=[-45, -25, -15, 0], projection="M10c", frame=["WSne", "af"])
fig.basemap(
region=[-45, -25, -15, 0],
projection="M10c",
frame=Frame(axes="WSne", axis=Axis(annot=True, tick=True)),
)
fig.coast(land="tan", water="steelblue")
fig.scalebar(
position=Position("BL", cstype="inside", offset=1),
Expand Down
Loading