Skip to content

Commit 87109dd

Browse files
Merge branch 'main' into add-gallery-area-curves
2 parents 0b222b5 + d435152 commit 87109dd

55 files changed

Lines changed: 358 additions & 120 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/gallery/seismology/meca.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
# %%
1515
import pygmt
16+
from pygmt.params import Axis
1617

1718
fig = pygmt.Figure()
1819

@@ -23,7 +24,7 @@
2324
land="grey",
2425
water="lightblue",
2526
shorelines=True,
26-
frame="a",
27+
frame=Axis(annot=True),
2728
)
2829

2930
# Store focal mechanism parameters in a dictionary based on the Aki & Richards

examples/intro/02_contour_map.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
# %%
1212
import pygmt
13+
from pygmt.params import Axis
1314

1415
# %%
1516
# Loading the Earth relief dataset
@@ -43,7 +44,7 @@
4344
# "oleron" is used; a full list of CPTs can be found at :gmt-docs:`reference/cpts.html`.
4445

4546
fig = pygmt.Figure()
46-
fig.grdimage(grid=grid, frame="a", projection="M10c", cmap="SCM/oleron")
47+
fig.grdimage(grid=grid, frame=Axis(annot=True), projection="M10c", cmap="SCM/oleron")
4748
fig.show()
4849

4950

@@ -63,7 +64,7 @@
6364
# :meth:`pygmt.Figure.grdimage`.
6465

6566
fig = pygmt.Figure()
66-
fig.grdimage(grid=grid, frame="a", projection="M10c", cmap="SCM/oleron")
67+
fig.grdimage(grid=grid, frame=Axis(annot=True), projection="M10c", cmap="SCM/oleron")
6768
fig.colorbar(annot=1000, label="Elevation", unit="m")
6869
fig.show()
6970

@@ -84,7 +85,7 @@
8485
# lines can be adjusted (separately) by specifying the desired ``pen``.
8586

8687
fig = pygmt.Figure()
87-
fig.grdimage(grid=grid, frame="a", projection="M10c", cmap="SCM/oleron")
88+
fig.grdimage(grid=grid, frame=Axis(annot=True), projection="M10c", cmap="SCM/oleron")
8889
fig.grdcontour(grid=grid, levels=500, annotation=1000)
8990
fig.colorbar(annot=1000, label="Elevation", unit="m")
9091
fig.show()
@@ -99,7 +100,7 @@
99100
# the ``shorelines`` parameter draws a border around the islands.
100101

101102
fig = pygmt.Figure()
102-
fig.grdimage(grid=grid, frame="a", projection="M10c", cmap="SCM/oleron")
103+
fig.grdimage(grid=grid, frame=Axis(annot=True), projection="M10c", cmap="SCM/oleron")
103104
fig.grdcontour(grid=grid, levels=500, annotation=1000)
104105
fig.coast(shorelines="2p", land="lightgray")
105106
fig.colorbar(annot=1000, label="Elevation", unit="m")

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
)

0 commit comments

Comments
 (0)