Skip to content

Commit e35ebcd

Browse files
authored
DOC/Test "test_rose": Migrate frame settings to the new Frame/Axis syntax (#4518)
1 parent 42533ad commit e35ebcd

1 file changed

Lines changed: 34 additions & 7 deletions

File tree

pygmt/tests/test_rose.py

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import pytest
77
from pygmt import Figure
88
from pygmt.datasets import load_sample_data
9+
from pygmt.params import Axis, Frame
910

1011

1112
@pytest.fixture(scope="module", name="data")
@@ -41,7 +42,11 @@ def test_rose_data_file(data_fractures_compilation):
4142
sector=15,
4243
diameter="5.5c",
4344
fill="blue",
44-
frame=["x0.2g0.2", "y30g30", "+glightgray"],
45+
frame=Frame(
46+
xaxis=Axis(annot=0.2, grid=0.2),
47+
yaxis=Axis(grid=30, annot=30),
48+
fill="lightgray",
49+
),
4550
pen="1p",
4651
norm="",
4752
scale=0.4,
@@ -62,7 +67,11 @@ def test_rose_2d_array_single():
6267
sector=10,
6368
diameter="5.5c",
6469
fill="cyan",
65-
frame=["x0.2g0.2", "y30g30", "+glightgray"],
70+
frame=Frame(
71+
xaxis=Axis(annot=0.2, grid=0.2),
72+
yaxis=Axis(grid=30, annot=30),
73+
fill="lightgray",
74+
),
6675
pen="1p",
6776
norm=True,
6877
scale=0.4,
@@ -82,7 +91,11 @@ def test_rose_2d_array_multiple(data):
8291
sector=10,
8392
diameter="5.5c",
8493
fill="blue",
85-
frame=["x0.2g0.2", "y30g30", "+gmoccasin"],
94+
frame=Frame(
95+
xaxis=Axis(annot=0.2, grid=0.2),
96+
yaxis=Axis(grid=30, annot=30),
97+
fill="moccasin",
98+
),
8699
pen="1p",
87100
norm=True,
88101
scale=0.4,
@@ -105,7 +118,11 @@ def test_rose_plot_data_using_cpt(data):
105118
sector=15,
106119
diameter="5.5c",
107120
cmap="SCM/batlow",
108-
frame=["x0.2g0.2", "y30g30", "+gdarkgray"],
121+
frame=Frame(
122+
xaxis=Axis(annot=0.2, grid=0.2),
123+
yaxis=Axis(grid=30, annot=30),
124+
fill="darkgray",
125+
),
109126
pen="1p",
110127
norm=True,
111128
scale=0.4,
@@ -127,7 +144,11 @@ def test_rose_plot_with_transparency(data_fractures_compilation):
127144
sector=15,
128145
diameter="5.5c",
129146
fill="blue",
130-
frame=["x0.2g0.2", "y30g30", "+glightgray"],
147+
frame=Frame(
148+
xaxis=Axis(annot=0.2, grid=0.2),
149+
yaxis=Axis(grid=30, annot=30),
150+
fill="lightgray",
151+
),
131152
pen="1p",
132153
norm=True,
133154
scale=0.4,
@@ -149,7 +170,9 @@ def test_rose_no_sectors(data_fractures_compilation):
149170
region=[0, 500, 0, 360],
150171
diameter="10c",
151172
labels="180/0/90/270",
152-
frame=["xg100", "yg45", "+tWindrose diagram"],
173+
frame=Frame(
174+
xaxis=Axis(grid=100), yaxis=Axis(grid=45), title="Windrose diagram"
175+
),
153176
pen="1.5p,red3",
154177
transparency=40,
155178
scale=0.5,
@@ -170,7 +193,11 @@ def test_rose_bools(data_fractures_compilation):
170193
region=[0, 1, 0, 360],
171194
sector=10,
172195
diameter="10c",
173-
frame=["x0.2g0.2", "y30g30", "+glightgray"],
196+
frame=Frame(
197+
xaxis=Axis(annot=0.2, grid=0.2),
198+
yaxis=Axis(grid=30, annot=30),
199+
fill="lightgray",
200+
),
174201
fill="red3",
175202
pen="1p",
176203
orientation=False,

0 commit comments

Comments
 (0)