Skip to content

Commit 164d61d

Browse files
authored
Migrate frame settings to the Frame/Axis class [frame="lrbt+gxxx+txxx"] (#4581)
1 parent 6c49a3d commit 164d61d

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

examples/gallery/symbols/patterns.py

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

3030
# %%
3131
import pygmt
32-
from pygmt.params import Pattern
32+
from pygmt.params import Frame, Pattern
3333

3434
# A list of patterns that will be demonstrated.
3535
# By default, a pattern is plotted in black and white with a resolution of 300 dpi.
@@ -52,7 +52,7 @@
5252
fig.basemap(
5353
region=[0, 10, 0, 12],
5454
projection="X18c/10c",
55-
frame="rlbt+glightgray+tBit and Hachure Patterns",
55+
frame=Frame(axes="rlbt", fill="lightgray", title="Bit and Hachure Patterns"),
5656
)
5757
y = 11
5858
for pattern in patterns:

examples/tutorials/advanced/legends.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@
8181
# Use the ``box`` parameter for adjusting the box around the legend.
8282

8383
fig = pygmt.Figure()
84-
fig.basemap(region=[-5, 5, -5, 5], projection="X5c", frame="rltb+glightgray")
84+
fig.basemap(
85+
region=[-5, 5, -5, 5], projection="X5c", frame=Frame(axes="rltb", fill="lightgray")
86+
)
8587

8688
fig.plot(x=0, y=0, style="c0.25c", fill="orange", label="orange circle")
8789
fig.plot(x=1, y=0, style="t0.3c", fill="pink", pen="black", label="pink triangle")
@@ -90,7 +92,9 @@
9092
fig.legend(position=Position("TL", offset=(0.3, 0.2)), box=True)
9193

9294
fig.shift_origin(xshift="w+1c")
93-
fig.basemap(region=[-5, 5, -5, 5], projection="X5c", frame="rltb+glightgray")
95+
fig.basemap(
96+
region=[-5, 5, -5, 5], projection="X5c", frame=Frame(axes="rltb", fill="lightgray")
97+
)
9498

9599
fig.plot(x=0, y=0, style="c0.25c", fill="orange", label="orange circle")
96100
fig.plot(x=1, y=0, style="t0.3c", fill="pink", pen="black", label="pink triangle")

0 commit comments

Comments
 (0)