Skip to content

Commit 939a4e8

Browse files
authored
Figure.inset: Fix a typo and improve existing tests (#4304)
1 parent 626a734 commit 939a4e8

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

pygmt/src/inset.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
@deprecate_parameter("margin", "clearance", "v0.18.0", remove_version="v0.20.0")
2525
@contextlib.contextmanager
2626
@use_alias(D="position", C="clearance")
27-
@kwargs_to_strings(D="sequence", M="sequence")
27+
@kwargs_to_strings(D="sequence", C="sequence")
2828
def inset(
2929
self,
3030
projection: str | None = None,
@@ -127,7 +127,7 @@ def inset(
127127
... # Map elements under the "with" statement are plotted in the inset
128128
... fig.coast(
129129
... region="g",
130-
... projection="G47/-20/3.5c",
130+
... projection="G47/-20/?",
131131
... land="gray",
132132
... water="white",
133133
... dcw="MG+gred",
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
outs:
2-
- md5: 813f2c05cf552a9a015c4cc44c9e4246
3-
size: 30075
2+
- md5: 22a63e75b37ec7ead76b11e3a84e9079
3+
size: 29982
44
path: test_inset_aliases.png
55
hash: md5
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
outs:
2-
- md5: fad7ee8d74cd61f73a8f218be6b0f9c0
3-
size: 10547
2+
- md5: fcd18ea3b048ac4e8813352163091a85
3+
size: 21349
44
path: test_inset_context_manager.png
55
hash: md5

pygmt/tests/test_inset.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ def test_inset_aliases():
1515
"""
1616
fig = Figure()
1717
fig.basemap(region="MG+r2", frame="afg")
18-
with fig.inset(position="jTL+w3.5c+o0.2c", clearance=0, box=Box(pen="green")):
19-
fig.basemap(region="g", projection="G47/-20/4c", frame="afg")
18+
with fig.inset(position="jTL+w3.5c+o0.2c", clearance=0.2, box=Box(pen="green")):
19+
fig.basemap(region="g", projection="G47/-20/?", frame="afg")
2020
return fig
2121

2222

@@ -28,7 +28,7 @@ def test_inset_context_manager():
2828
"""
2929
fig = Figure()
3030
fig.basemap(region=[-74, -69.5, 41, 43], projection="M9c", frame=True)
31-
with fig.inset(position="jBL+w3c+o0.2c", clearance=0, box=Box(pen="black")):
32-
fig.basemap(region=[-80, -65, 35, 50], projection="M3c", frame="afg")
31+
with fig.inset(position="jBL+w3c+o0.2c", clearance=0.2, box=True):
32+
fig.basemap(region="g", projection="G47/-20/?", frame="afg")
3333
fig.basemap(rose="jTR+w3c") # Pass rose argument with basemap after the inset
3434
return fig

0 commit comments

Comments
 (0)