Skip to content

Commit 839851c

Browse files
committed
Add tests for Figure.directional_rose
1 parent 753be82 commit 839851c

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
outs:
2+
- md5: 4bf9dc9a74af3df5fe03ba4cdfaf27ca
3+
size: 14424
4+
hash: md5
5+
path: test_directional_rose_complex.png
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
"""
2+
Test Figure.directional_rose.
3+
"""
4+
5+
import pytest
6+
from pygmt import Figure
7+
8+
9+
@pytest.mark.mpl_image_compare(filename="test_basemap_rose.png")
10+
def test_directional_rose():
11+
"""
12+
Test the Figure.directional_rose method.
13+
"""
14+
fig = Figure()
15+
fig.basemap(region=[127.5, 128.5, 26, 27], projection="H15c", frame=True)
16+
fig.directional_rose(position="MC", position_type="inside", width="5c")
17+
return fig
18+
19+
20+
@pytest.mark.mpl_image_compare
21+
def test_directional_rose_complex():
22+
"""
23+
Test the Figure.directional_rose method with more parameters.
24+
"""
25+
fig = Figure()
26+
fig.basemap(region=[0, 80, -30, 30], projection="M10c", frame=True)
27+
fig.directional_rose(
28+
position=(50, 0),
29+
position_type="mapcoords",
30+
width="1c",
31+
label=["", "", "", "N"],
32+
fancy=2,
33+
anchor="MC",
34+
anchor_offset=(1, 1),
35+
)
36+
return fig

0 commit comments

Comments
 (0)