Skip to content

Commit d435152

Browse files
authored
Migrate frame settings to the Frame/Axis class [frame='af' and frame='afg'] (#4531)
1 parent 99661c7 commit d435152

41 files changed

Lines changed: 252 additions & 75 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

examples/gallery/embellishments/timestamp.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import os
1313

1414
import pygmt
15+
from pygmt.params import Axis
1516

1617
fig = pygmt.Figure()
1718
fig.basemap(region=[20, 30, -10, 10], projection="X10c/5c", frame=True)
@@ -25,7 +26,13 @@
2526
os.environ["TZ"] = "Pacific/Honolulu" # optionally set the time zone
2627

2728
fig = pygmt.Figure()
28-
fig.coast(region="d", projection="H10c", land="black", water="cornsilk", frame="afg")
29+
fig.coast(
30+
region="d",
31+
projection="H10c",
32+
land="black",
33+
water="cornsilk",
34+
frame=Axis(annot=True, tick=True, grid=True),
35+
)
2936
fig.timestamp(
3037
label="Powered by PyGMT",
3138
justify="TL",

examples/gallery/images/cross_section.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
# %%
1616
import pygmt
17-
from pygmt.params import Box, Position
17+
from pygmt.params import Axis, Box, Position
1818

1919
# Define region of study area
2020
# lon_min, lon_max, lat_min, lat_max in degrees East and North
@@ -30,7 +30,7 @@
3030
# Bottom: Map of elevation in study area
3131

3232
# Set up basic map using a Mercator projection with a width of 12 centimeters
33-
fig.basemap(region=region_map, projection="M12c", frame="af")
33+
fig.basemap(region=region_map, projection="M12c", frame=Axis(annot=True, tick=True))
3434

3535
# Download grid for Earth relief with a resolution of 10 arc-minutes and gridline
3636
# registration [Default]

examples/gallery/maps/borders.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,16 @@
1818

1919
# %%
2020
import pygmt
21+
from pygmt.params import Axis
2122

2223
fig = pygmt.Figure()
2324
# Make a Sinusoidal projection map of the Americas with automatic annotations,
2425
# ticks and gridlines
25-
fig.basemap(region=[-150, -30, -60, 60], projection="I-90/15c", frame="afg")
26+
fig.basemap(
27+
region=[-150, -30, -60, 60],
28+
projection="I-90/15c",
29+
frame=Axis(annot=True, tick=True, grid=True),
30+
)
2631
# Plot each level of the boundaries dataset with a different color.
2732
fig.coast(borders=["1/0.5p,black", "2/0.5p,red", "3/0.5p,blue"], land="gray")
2833
fig.show()

examples/gallery/maps/country_polygons.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
# %%
1414
import pygmt
15+
from pygmt.params import Axis
1516

1617
fig = pygmt.Figure()
1718

@@ -21,7 +22,7 @@
2122
projection="A10/52/25/6c",
2223
land="gray",
2324
water="white",
24-
frame="afg",
25+
frame=Axis(annot=True, tick=True, grid=True),
2526
dcw=[
2627
# Great Britain (country code) with seagreen land
2728
"GB+gseagreen",
@@ -54,7 +55,7 @@
5455
projection="H10c",
5556
land="gray",
5657
water="white",
57-
frame="afg",
58+
frame=Axis(annot=True, tick=True, grid=True),
5859
dcw=[
5960
# Europe
6061
"=EU+gseagreen",

examples/gallery/maps/tilemaps.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
# %%
1010
import contextily
1111
import pygmt
12+
from pygmt.params import Axis
1213

1314
fig = pygmt.Figure()
1415
fig.tilemap(
@@ -22,7 +23,7 @@
2223
zoom=14,
2324
# Use tiles from OpenStreetMap tile server
2425
source="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
25-
frame="afg",
26+
frame=Axis(annot=True, tick=True, grid=True),
2627
)
2728

2829
fig.show()
@@ -39,7 +40,7 @@
3940
projection="M12c",
4041
# Use the CartoDB Positron option from contextily
4142
source=contextily.providers.CartoDB.Positron,
42-
frame="afg",
43+
frame=Axis(annot=True, tick=True, grid=True),
4344
)
4445

4546
fig.show()

examples/projections/azim/azim_equidistant.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,14 @@
2020

2121
# %%
2222
import pygmt
23+
from pygmt.params import Axis
2324

2425
fig = pygmt.Figure()
2526
fig.coast(
26-
region="g", projection="E-100/40/15c", frame="afg", land="khaki", water="white"
27+
region="g",
28+
projection="E-100/40/15c",
29+
frame=Axis(annot=True, tick=True, grid=True),
30+
land="khaki",
31+
water="white",
2732
)
2833
fig.show()

examples/projections/azim/azim_general_perspective.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,13 @@
3030

3131
# %%
3232
import pygmt
33+
from pygmt.params import Axis
3334

3435
fig = pygmt.Figure()
3536
fig.coast(
3637
region="g",
3738
projection="G4/52/12c+a30+t45+v60/60+w0+z250",
38-
frame="afg",
39+
frame=Axis(annot=True, tick=True, grid=True),
3940
land="khaki",
4041
water="white",
4142
)

examples/projections/azim/azim_general_stereographic.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,13 @@
2020

2121
# %%
2222
import pygmt
23+
from pygmt.params import Axis
2324

2425
fig = pygmt.Figure()
2526
fig.coast(
2627
region=[4, 14, 52, 57],
2728
projection="S0/90/12c",
28-
frame="afg",
29+
frame=Axis(annot=True, tick=True, grid=True),
2930
land="khaki",
3031
water="white",
3132
)

examples/projections/azim/azim_gnomonic.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,13 @@
2121

2222
# %%
2323
import pygmt
24+
from pygmt.params import Axis
2425

2526
fig = pygmt.Figure()
2627
fig.coast(
2728
region="g",
2829
projection="F-90/15/12c",
29-
frame="afg",
30+
frame=Axis(annot=True, tick=True, grid=True),
3031
land="khaki",
3132
water="white",
3233
)

examples/projections/azim/azim_lambert.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@
1818

1919
# %%
2020
import pygmt
21+
from pygmt.params import Axis
2122

2223
fig = pygmt.Figure()
2324
fig.coast(
2425
region="g",
2526
projection="A30/-20/60/12c",
26-
frame="afg",
27+
frame=Axis(annot=True, tick=True, grid=True),
2728
land="khaki",
2829
water="white",
2930
)

0 commit comments

Comments
 (0)